Last Updated: February 25, 2016
·
618
· herchila

How to list unpushed commits (using alias)

There are 2 ways to do it: simplified on a single line or not simplified with more details.

Simplified form

$ git log --branches --not --remotes --simplify-by-decoration --decorate --oneline

output:

a0ea499 (HEAD, master) Fix html layout.
49f7b9c (hotfix) Fix javascript validation in contact form.
ff48529 (deletedusers) New model to admin deleted users.

Complete form

Simply remove the following: --oneline

$ git log --branches --not --remotes --simplify-by-decoration --decorate

output:

commit a0ea499... (HEAD, master)
Author: Hernan <hernan@gmail.com>
Date:   Mon Jul 28 11:39:44 2014 -0300

    Fix html layout.

but... is so long write this each time, so... we will create an alias :)

Edit .gitconfig file

[alias]
        unpushed = log --branches --not --remotes --simplify-by-decoration --decorate --oneline

and then...

Use it!

$ git unpushed

source StackOverflow