For reference:
After push, git says everything up to date but changes are not in the repo
Remote repo says it is up-to-date, but lacks hundreds of local commits
git repo says it's up-to-date after pull but files are not updated
My case is a bit different. I'm not being told that everything is up to date. Each time I push I'm given the $OLD_HASH..$NEW_HASH branch -> branch
message as expected, and when I look at the logs for both the branch I'm on as well as remote/branch, it shows the two are up-to-date.
However, when I try to pull on my laptop, it says "Already up to date" so I push again getting the same message as before, saying that the commit is being pushed. That is to say, it pushed the same commit again.
Just to be sure I clone the repo, and sure enough the pushed commit (just one) is missing.
I check the URLs, just to make sure nothing weird happened without my knowledge. I then hop on the internet and try to find out what other people have done.
The common solutions are in response to pushing and being told that "Everything up to date". The solution to that problem is to add everything, commit, and then push. However this is not the case for me, since I have a commit, it is being pushed (repeatedly) and locally it is shown as having been pushed.
Another thing suggested was git push remote branch:branch
which I did try without any difference in effectiveness.
The next thing I tried was to fetch. After fetching the local repo's log shows that the HEAD of the remote branch is indeed one commit behind, however when I then push (without real effect) it is shown to have moved, when in reality it has not as verified by trying to pull to the clone.
The remote seems to be fine. I pushed to it earlier from my laptop and pulled to my desktop.
Finally I tried
cp file temp
fit fetch --all
git reset --hard remote/branch
mv temp file
git add file
git commit -m"message"
git push
where file
is the file I had been working on. However this didn't work any better than what had been tried before (in other words, not at all). Also, please take note that I do not think that git reset --hard
is affecting the remote. Rather, I know it is affecting the local repo only.
Just not I tried pushing to a different repo on the same server, and its working fine. Its just the one repo, which was working fine a few hours ago.
Moreover, looking at the remote's own client on my tablet (as opposed to CLI git I've been using) it shows that I pushed to the remote minutes ago, even though the commit isn't showing.
I was requested to share the output of git status
$ git status
On branch devel
Your branch is up to date with 'origin/devel'.
nothing to commit, working tree clean
Another thing I just tried was to git checkout -b test
then git push -u remote test
but the branch didn't actually get pushed despite git saying that it was.
I just tried making a new remote repo. I removed the remote from the local repo, added the new remote, then pushed with git push -u
. Same result. That one commit isn't making it into the remote for some reason.
As for a complete (albeit obfuscated) push output:
$ git push
Initializing Keybase... done.
Syncing with Keybase... done.
To keybase://private/my/repo
hashA..hashB branch -> branch
As I said, no errors, but that isn't to say this is normal. For another repo:
$ git push
Initializing Keybase... done.
Syncing with Keybase... done.
Counting and decrypting: 4 objects... done.
Preparing and encrypting: (100.00%) 4/4 objects... done.
Indexing hashes: (100.00%) 4/4 objects... done.
Indexing CRCs: (100.00%) 4/4 objects... done.
Indexing offsets: (100.00%) 4/4 objects... done.
Syncing encrypted data to Keybase: (100.00%) 200.65/200.65 KB... done.
To keybase://private/my/otherRepo
hashC..hashD otherBranch -> otherBranch
I took another look at the git logs, and it seems as if there is some strange divergence going on. The commit I keep trying to push exists in multiple branches (normal) with three different commit hashes (not normal). I'm going to look into this further. I'm not completely sure what is going on, so I can't give an accurate report, but this is new information.
In fact, now that I'm looking at the history, instead of just the tips, something really weird is going on. My local repos are messed up. I knew they weren't in an especially good state (I rebased down to the root to fix a missing filter problem which separated everything into discrete branches with no common hystory) but I don't think that is the cause of this.
Still, if I force push I'd expect the commit to be there no matter what.