Subject: Re: Triangular workflow

From: Junio C Hamano <[email-masked]>
Date: Wed, 14 Jan 2026 06:15:05 -0800

Jeff King <[email-masked]> writes:

> So even if I only do it infrequently, it feels weird that a bare "git
> push" would try to push to the upstream remote (which I don't even have
> write access to!).

Yes, exactly.  I was wondering where Harald's suggestion to swap the
two remotes came from.

> Yeah, though @{push} is usually not explicitly configured in the same
> way @{upstream} is, but rather a consequence of how push.default and
> remote.pushdefault interact. But it was added for exactly this kind of
> triangular workflow. I sometimes will do stuff like:
>
>   git range-diff origin @{push} HEAD
>
> to compare two iterations of a branch if I know that I haven't pushed.
> It is a bit of a cheat, because what I really mean is "do a range-diff
> since the last thing I sent to the list". But if I have just been
> working on a branch, and I haven't run an integration cycle since then,
> then I know that the pushed version will match it.

Great suggestion.  It is fun to see that comparing notes among
people with different workflows brings out these gems ;-)

> There is also branch.*.pushRemote, but I have not found that useful (for
> my triangular flow there is always a single repo to push to, not one per
> branch).