Re: How can git pull be up-to-date and git push fail?
From: Bill Lear <hidden>
Date: 2016-06-15 22:43:03
On Thursday, April 5, 2007 at 09:07:11 (-0500) Bill Lear writes:
... Hmm.... I wonder if his remote repo is non-bare... I'll try to find out.
Yes, it is. Here is the reply I got from my friend:
Bill Lear writes:quoted
So, the remote repo to which you pushed originally is non-bare? That is, it has working files checked out?Correct.quoted
If so, that is a problem, but perhaps not the cause of your problems. Never push to a non-bare repo: you need to go that repo and do a pull instead.I've been able to work around such problems. I know well about the double-commit reversal whammy that can happen (since it happened to me). If I push to a non-bare repo that's otherwise got no file modifications in it, I can do a "git status" to see what files it thinks are out of date, which tells me (by the file list) that the push succeeded. Then I just do a "git checkout -f" to sync up. Up til now, has worked like a charm. Alternately, I switch to some bogus temporary branch in the non-bare repo I'm pushing to & switch back after.
Bill