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}..
Written by David Brailovsky
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#