git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Interleaved remote branch update problems

From
Jeff King <peff@peff.net>
Date
Apr 6, 2012, 00:37 UTC
Message-ID
<20120406003710.GC14224@sigill.intra.peff.net>
In-Reply-To
<201204051549.14397.mfick@codeaurora.org>
On Thu, Apr 05, 2012 at 03:49:14PM -0600, Martin Fick wrote:
Show 5 quoted lines
> I have noticed that git push --force does not reliably force 
> a push to remote branches.  In particular, it will not 
> update a remote branch if that branch has been updated since 
> the beginning of the push.  Is this normal, is this 
> expected?

Yes, that's expected. --force means "it's OK to push something that will rewind history", not "it's OK to clobber somebody else who is pushing at the same time". The determination for the former happens on the client side, and for the latter on the server side.

If you want the latter, you would need a protocol extension, I think; I'm pretty sure the client doesn't transmit the force flag at all to the server (and I don't think this should be tied to the force flag automatically; they are two different cases, and you may be in a situation where it is safe to do the former but not necessarily the latter).

-Peff
Previous: Martin FickNext: Martin Fick
Message 2 of 4 in “Interleaved remote branch update problems”
  1. Martin FickApr 5, 2012
  2. Jeff KingApr 6, 2012
  3. Martin FickApr 6, 2012
  4. Jeff KingApr 6, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.