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

Re: Problem with a push

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jun 12, 2007, 18:01 UTC
Message-ID
<alpine.LFD.0.98.0706121055090.14121@woody.linux-foundation.org>
In-Reply-To
<7vk5u9hzv9.fsf@assigned-by-dhcp.pobox.com>
On Tue, 12 Jun 2007, Junio C Hamano wrote:
Show 7 quoted lines
> 
> I think what we might want to do around this area are:
> 
>  - Don't change anything, if the command line says refspec, or
>    the remote has push refspec specified.
> 
>  - When doing 'matching refs', do it only under refs/heads/.
I think these both are "obviously good".
>  - Ship with a receive-pack hook that attempts a 3-way merge
>    update when the currently checked out branch is updated.

Well, if it wasn't a fast-forward, then the user did a push with "git push -f", which implies _replacing_ the currently checked out branch.

So by three-way, I assume you mean the "git checkout -m" behaviour, and a fast-forward. What about a non-fast-forward (ie "git push -f"?) Should that imply "git checkout -f" semantics on the receiving side? That would kind of be sensible.

		Linus
Previous: Junio C HamanoNext: Martin Langhoff
Message 13 of 15 in “Problem with a push”
  1. Alex R.M. TurnerJun 11, 2007
  2. Linus TorvaldsJun 11, 2007
  3. Alex R.M. TurnerJun 11, 2007
  4. Linus TorvaldsJun 12, 2007
  5. Junio C HamanoJun 12, 2007
  6. Alex R.M. TurnerJun 12, 2007
  7. Linus TorvaldsJun 12, 2007
  8. Jon LoeligerJun 12, 2007
  9. Junio C HamanoJun 11, 2007
  10. Andy ParkinsJun 12, 2007
  11. Linus TorvaldsJun 12, 2007
  12. Junio C HamanoJun 12, 2007
  13. Linus TorvaldsJun 12, 2007
  14. Martin LanghoffJun 12, 2007
  15. "git-push $URL" without refspecs pushes only matching branchesJunio C Hamano, Jul 2, 2007

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.