[edit: added command outputs as requested, and reorganized for clarity] I've got two clones of a particular repo checked out.
git log
commit e06424b5...
...
commit 557a0eb8...
shows the same thing in both, with same hash at the top.
git remote show origin
same in both
git branch
* master
still same in both
Now some differences.
From the 'good' clone:
git log origin/master..
commit e06424b5...
git show-ref HEAD
e06424b5... refs/remotes/origin/HEAD
# On branch master
nothing to commit (working directory clean)
From the 'bad' clone:
git log origin/master..
commit 557a0eb8...
git show-ref HEAD
557a0eb8... refs/remotes/origin/HEAD
git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
This is different [correction: earlier I reported that this output was the same]. show-ref seems to indicate that this checkout is one commit behind, while status says it is ahead. But git reset --hard e06424b5
changes nothing.
When I ask the 'bad' clone what it thinks needs to be pushed:
git diff --stat origin/master
it shows the files that were part of the e06424b5 commit, but in fact the only reason this checkout even has those files is because I pulled them.
Anyone know how to make the checkout realize that there's nothing for it to push?
[edit: here are some additional commands and their outputs from the 'bad' clone...]
git log --graph --decorate --oneline
* e06424b (HEAD, master)
* 557a0eb (origin/master, origin/HEAD)
git rev-parse origin/master
557a0eb
git rev-parse HEAD
557a0eb (the previous hash)
e06424b (the correct, most recent hash)