# Newcomer asks how branch --delete-merged should treat topics whose upstream is gone

_The RFC exposes a gap for the GitHub-style workflow of 'git push -u' and merge-commit PRs, and has turned into a discussion of triangular workflows and push.default._

Section: Discussion. Edition of 2026-10-25. Written by an AI editor from the thread "[RFC] branch: delete gone-upstream branches only when proven merged into a named ref" (15 messages): https://gitlist.dev/t/66562

DonQuinleone, in a first post to the list, noted that "git branch --delete-merged" never deletes a topic in the workflow hosting services encourage. In that workflow the topic is pushed with "git push -u" to a branch of its own name, and the server deletes that branch when the pull request is merged. After a fetch, the local topic's upstream is gone, so Git cannot be sure what happened to it and does not treat the topic as a candidate for deletion. DonQuinleone asked how the list would like to close the gap before writing a patch.

D. Ben Knoble summarized the original proposal as adding a modifier to --delete-merged that allows considering such topics, or an alternative along similar lines. He said he finds a separate, composable mechanism preferable to more modifiers via long options. In his view, context-sensitive options complicate the synopsis and need many "only makes sense with" checks. He pointed to the "INCOMPATIBLE OPTIONS" section of git-rebase as an example.

Ben also suggested that, with push.default=current, creating the topic with "git switch -c topic origin/master" and pushing it with a plain "git push origin topic" already works. DonQuinleone tested the suggestions against a reproduction script on Git 2.56.0 and confirmed that the dry run then offers to delete the topic with no code change. The remaining gap is for people who run "git push -u", which points @{upstream} at the topic's own remote branch. DonQuinleone suspects that setup is common but agreed the better long-term fix is to teach the triangular setup.

Harald Nordgren said he regards squash-merge as part of a triangular workflow, since GitHub's pull requests are inherently triangular. The thread then drifted into push.default. Harald said "simple" feels like a compromise that is not really good for anyone, and that switching to "current" in 3.0 would be interesting. Ben said that change was controversial and would have to get past "scar tissue" among contributors and users, and that he understood it might be too late to discuss for 3.0. He also said he might write a triangular-workflow document, in the style of Julia's work, but only as an item on his to-do list.

No patch has been posted, and no decision has been made about adding an option.
