git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ben Denhartog" <ben@sudoforge.com>
Cc: "Jeff King" <peff@peff.net>, git@vger.kernel.org
Subject: Re: Unexpected behavior with branch.*.{remote,pushremote,merge}
Date: Fri, 04 Dec 2020 11:57:23 -0800	[thread overview]
Message-ID: <xmqq360lfios.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <112958f6-0eca-453d-86f3-52e7054a88f9@www.fastmail.com> (Ben Denhartog's message of "Fri, 04 Dec 2020 09:45:17 -0700")

"Ben Denhartog" <ben@sudoforge.com> writes:

> 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.

  reply	other threads:[~2020-12-04 19:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04  1:26 Unexpected behavior with branch.*.{remote,pushremote,merge} Ben Denhartog
2020-12-04  2:31 ` Felipe Contreras
2020-12-04 16:44   ` Ben Denhartog
2020-12-04 21:29     ` Felipe Contreras
2020-12-04 10:13 ` Jeff King
2020-12-04 16:45   ` Ben Denhartog
2020-12-04 19:57     ` Junio C Hamano [this message]
2020-12-04 21:00       ` Jeff King
2020-12-04 22:20         ` Ben Denhartog
  -- strict thread matches above, loose matches on Subject: below --
2020-10-10 18:27 Ben Denhartog
2020-10-10 18:38 ` Ben Denhartog

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq360lfios.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=ben@sudoforge.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).