From: Bill Lear Date: Thu, 05 Apr 2007 14:25:29 GMT Subject: Re: How can git pull be up-to-date and git push fail? Message-ID: <17941.1753.893556.725405@lisa.zopyra.com> In-Reply-To: <17941.655.192938.792088@lisa.zopyra.com> 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: > > So, the remote repo to which you pushed originally is non-bare? That > > is, it has working files checked out? > >Correct. > > > 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