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

Re: Triangular workflows

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Jan 5, 2026, 22:19 UTC
Message-ID
<CALnO6CB7-w0tNMiYn5=SCBow637vRRrKRj_9k1h1DS4crJaVtQ@mail.gmail.com>
In-Reply-To
<CAHwyqnWwJuD4T9tuCArW5eY=rPCHKT71LroRRx-aYfDGwr8E9g@mail.gmail.com>
On Thu, Jan 1, 2026 at 2:43 PM Harald Nordgren <haraldnordgren@gmail.com> wrote:
Show 12 quoted lines
>
> 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
Next: D. Ben Knoble
Message 1 of 2 in “Re: Triangular workflows”
  1. D. Ben KnobleJan 5, 2026
  2. D. Ben KnobleJan 5, 2026

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.