From: Jeff King <peff@peff.net>
To: Surenkumar Nihalani <suren.k.n@icloud.com>
Cc: git@vger.kernel.org
Subject: Re: Bug report for git push
Date: Sat, 12 May 2018 04:45:23 -0400 [thread overview]
Message-ID: <20180512084523.GA28279@sigill.intra.peff.net> (raw)
In-Reply-To: <27C6F6E9-2F80-48A6-B551-4AE9957C98A5@icloud.com>
On Fri, May 11, 2018 at 09:44:54PM -0400, Surenkumar Nihalani wrote:
> Push summary: [remote rejected] (cannot lock ref 'refs/heads/master': is at cf2cc0c147d8215ec87d3ddaf32f0b2c58630423 but expected fdda486ad43a6e6b5dc5f2795ce27124e0686752)
This generally indicates that somebody was pushing at the same time as
you, and you lost the race. The push conversation works basically like
this:
1. server advertise master at some sha1 (like fdda486ad)
2. client checks that moving from fdda486ad to whatever the new value is
(let's say 1234abcd) matches its criteria (e.g., not a fast-forward)
and prepares a pack with the appropriate objects
3. client tells server "update master from fdda486ad to 1234abcd"
4. server locks master and then under lock checks that it's still at
fdda486ad. In this case it's not, so it aborts the lock. This is
likely due to somebody else pushing in the interim.
If you push again at this point, the client will notice in step that
it's not a fast-forward and give you the "somebody else has pushed, you
need to pull first" error message.
The only difference here is that because of the timing (i.e., somebody
pushing at the exact same time as you), only the server's locking
operation noticed the conflict. But the fix is the same (pull their
work, then push).
-Peff
prev parent reply other threads:[~2018-05-12 8:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-12 1:44 Bug report for git push Surenkumar Nihalani
2018-05-12 8:45 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180512084523.GA28279@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=suren.k.n@icloud.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).