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

Re: Unexpected behavior with branch.*.{remote,pushremote,merge}

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 4, 2020, 19:57 UTC
Message-ID
<xmqq360lfios.fsf@gitster.c.googlers.com>
In-Reply-To
<112958f6-0eca-453d-86f3-52e7054a88f9@www.fastmail.com>
"Ben Denhartog" <ben@sudoforge.com> writes:
Show 8 quoted lines
> To the rest of your message:
>
> I did not understand the behavior of `fetch --all`; what you've
> described makes sense to me (although I would agree that it sounds
> like there's a bug). Between the following steps I'll take, I
> think my fork workflow is "fixed":
>
> * Refactor away from usage of FETCH_HEAD

Yes, "fetch --all" is about updating the remote-tracking branches and in retrospect, perhaps we might have avoided confusion if we made it not to touch FETCH_HEAD, but it is not going to change now.

> * Set `remote.pushdefault = origin`
> * Set `push.default = current` (instead of `simple`, and is what
> my global config sets this to)

I have a feeling that simple vs current does not make a difference if you are pusing main to main, and if so, push.default could be left to the default settings of 'simple'. But the key to successful use of the triangular workflow is to configure so that "fetch/pull" goes to one place (i.e. your upstream) and "push" goes to another (i.e. your publishing repository), and "remote.pushdefault" is a good ingredient to do so.

It is however more common to use 'origin' as the name of your upstream repository (so that "git fetch" and "git pull" would grab things from there by default) and set remote.pushdefault to the remote you push into, though (iow, I found remote.pushdefault pointing at 'origin' a bit unusual). Doing so may make your triangular workflow work smoother.

> I appreciate your insight and the identification of the problem.

Thanks for a concluding comment to report a success. It's reassuring to hear a positive feedback.

Previous: Ben DenhartogNext: Jeff King
Message 7 of 9 in “Unexpected behavior with branch.*.{remote,pushremote,merge}”
  1. Ben DenhartogDec 4, 2020
  2. Felipe ContrerasDec 4, 2020
  3. Ben DenhartogDec 4, 2020
  4. Felipe ContrerasDec 4, 2020
  5. Jeff KingDec 4, 2020
  6. Ben DenhartogDec 4, 2020
  7. Junio C HamanoDec 4, 2020
  8. Jeff KingDec 4, 2020
  9. Ben DenhartogDec 4, 2020

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.