Last Updated: February 25, 2016
·
610
· davidbrai

Git alias to list unpushed commits

Add the follow alias to your ~/.gitconfig:

[alias]
    unpushed = !BRANCH=$(git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3) && git log origin/$BRANCH..$BRANCH`

This will show a git log output of the commits you haven't pushed to origin on your current branch.

Update:
Looks like there's a simpler way now, just do:

git log @{u}..