Once you have done git push
that should make origin/somebranch
and somebranch
point to the same SHA, so I would not expect git diff origin/somebranch
to show any differences, since that is diffing against HEAD
, which is somebranch
. Try it after you commit and before you push to see your changes.
The reason that git diff origin somebranch
is showing changes is due to how git is interpreting origin
. I'm guessing it is interpreting it to mean origin/HEAD
from when it fetched the remote, and that the remote HEAD was something other than somebranch
. You can verify this by
git rev-parse origin
git name-rev origin
or from your top level directory and presuming your refs aren't packed
cat .git/refs/remotes/origin/HEAD