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
git cherry -v
This will list out your local comment history (not yet pushed) with corresponding message
This worked better for me:
git log --oneline @{upstream}..
or:
git log --oneline origin/(remotebranch)..
To list all unpushed commit in all branches easily you can use this command:
git log --branches @{u}..
You can do this with git log:
git log origin..
Assuming that origin
is the name of your upstream, leaving off any revision name after ..
implies HEAD
, which lists the new commits that haven't been pushed.
It is not a bug. What you probably seeing is git status after a failed auto-merge where the changes from the remote are fetched but not yet merged.
To see the commits between local repo and remote do this:
git fetch
This is 100% safe and will not mock up your working copy. If there were changes git status
wil show X commits ahead of origin/master
.
You can now show log of commits that are in the remote but not in the local:
git log HEAD..origin
git log origin/master..HEAD
You can also view the diff using the same syntax
git diff origin/master..HEAD