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

Re: [RFC] branch: delete gone-upstream branches only when proven merged into a named ref

From
Harald Nordgren <haraldnordgren@gmail.com>
Date
Oct 22, 2026, 13:43 UTC
Message-ID
<CAHwyqnWi3MCvAw-sNrn6k3ht1tpUfmNg18BAvEThKthen5Dwmw@mail.gmail.com>
In-Reply-To
<CALnO6CAsCvJRywkw0WpO1nEhL+yU2-r_4Z2AHdJch1m=NK8=TA@mail.gmail.com>
Show 20 quoted lines
> Ah, but the manual seems to contradict my (personal) "natural" reading
> of the command: "--delete-merged" actually deletes branches whose tip
> is reachable from their upstream (when that upstream matches the given
> pattern). So, phooey. In this case, if "topic@{upstream}" was
> "origin/master", though, "--delete-merged=origin/*" would work, no?
> Incidentally, I find it a shame that GitHub's documentation encourages
> a triangular workflow (whether or not there is a fork remote involved)
> without talking about how to configure Git to help you: fork or not,
> if you push to a topic branch but merge to another, it's extremely
> handy to use push.default=current or some variant so that
>
> - @{upstream} is the place you'll merge
> - @{push} is the place you push
>
> and suddenly "git pull [--rebase]" does the right thing, "git status"
> (esp. with the new "status.compareBranches") can tell you where you
> are relative to both places of interest, etc.
>
> IOW, "git push -u origin topic" makes upstream configuration very odd
> in the GitHub-ish workflow!
Fully agree!

I would say most workflows are triangular on the underlying level, even if the developer is not aware of it. If you work with GitHub PRs or GitLab's MR, then you are engaging in a triangular workflow.

I picked up some important tricks for visualizing the triangular on this mailing list. But most of our users are not on the mailing list. But what we can and should do is to make git itself clearer, so they have a chance of intuiting it. I think for example that

    push.default=current
should likely be the default. And many people would have a better time with
    branch.autosetupmerge=inherit

which gives you upstream/master as @{u} from the beginning, and then you likely never abandon that if you are a regular GitHub user.

This is also why I feel strongly about this as default (https://lore.kernel.org/git/pull.2458.git.git.1792437798463.gitgitgadget@gmail.com/):

    status.comparebranches=@{upstream} @{push}

because it's confusing to switch tracking away from your "own branch" to upstream/master, if that means losing the waypoint of how things compare against @{push}.

Harald
Previous: D. Ben KnobleNext: D. Ben Knoble
Message 3 of 15 in “[RFC] branch: delete gone-upstream branches only when proven merged into a named ref”
  1. DonQuinleoneOct 17, 2026
  2. D. Ben KnobleOct 22, 2026
  3. Harald NordgrenOct 22, 2026
  4. D. Ben KnobleOct 24, 2026
  5. Harald NordgrenOct 24, 2026
  6. D. Ben KnobleOct 24, 2026
  7. Harald NordgrenOct 22, 2026
  8. Ben KnobleOct 22, 2026
  9. Harald NordgrenOct 22, 2026
  10. Harald NordgrenOct 22, 2026
  11. D. Ben KnobleOct 24, 2026
  12. DonQuinleoneOct 24, 2026
  13. Harald NordgrenOct 24, 2026
  14. D. Ben KnobleOct 27, 2026
  15. D. Ben KnobleOct 24, 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.