From: D. Ben Knoble Date: Mon, 05 Jan 2026 22:19:36 GMT Subject: Re: Triangular workflows Message-ID: In-Reply-To: On Thu, Jan 1, 2026 at 2:43 PM Harald Nordgren wrote: > > Hi Ben! > > Did you ever get to this? And does it match what I do in the tests for PATCH v10: > > ``` > git config remote.pushDefault origin > git branch --set-upstream-to upstream/main > ``` > > > Harald Yeah, that's definitely part of it for me. I've been meaning to write this down elsewhere for a while, but here's what my setup for triangular workflows looks like. First, there are typically 2 remotes (but not always!). In the examples, I'll use "origin" (the place I usually cloned from first, the most official version of the code, etc.; also the place I pull from) and "benknoble" (the place I push to). The setup works just fine with a single origin, though. Next, I globally configure push.default = current pull.rebase = true branch.autoSetupRebase = always The first works with other settings to make the @{push} ref work (and to make "git push" work without arguments). I really like the @{push} ref, and I'm not aware of any other way to enable it. Then, when setting up a repository I configure remotes and make sure to configure remote.pushDefault = benknoble (if there is such a remote). The next step is usually starting a branch: git switch -c branch origin # or origin/main, or whatever With the above settings, I immediately have - branch@{upstream} (@{u}) -> origin/… - branch@{push} (@{push}) -> benknoble/branch (or origin/branch, depending on the case) -- D. Ben Knoble