git-log - git log show diff - Viewing unpushed Git commits

git diff specific file / git / git-diff

How can I view any local commits I've made, that haven't yet been pushed to the remote repository? Occasionally, git status will print out that my branch is X commits ahead of origin/master, but not always.

Luke Girvin



Answer #1

I believe the most typical way of doing this is to run something like:

git cherry --abbrev=7 -v @{upstream}

However, I personally prefer running:

git log --graph --decorate --pretty=oneline --abbrev-commit --all @{upstream}^..
git config --global alias.noup \
'log --graph --decorate --pretty=oneline --abbrev-commit --all @{upstream}^..'