Re: [PATCH v9 3/5] branch: add --prune-merged <remote>
- From
Harald Nordgren <haraldnordgren@gmail.com>
- Date
- May 21, 2026, 12:37 UTC
- Message-ID
- <CAHwyqnVMpBA=fk8giP4E45FR_7UDpgr8GHYXV9Q2C3Skxxb5gA@mail.gmail.com>
- In-Reply-To
- <6501a3d5-a5ec-421b-8526-ee7d4ae5ea98@gmail.com>
Show 35 quoted lines
> I think being able to prune branches that have been merged into their > upstream is a good idea. However, I find the focus on remotes rather > than upstream branches in the UI a bit confusing. While the upstream of > a branch is often a remote tracking branch it doesn't have to be. For my > personal projects I often do > > git checkout -b topic master > > and it would be nice to be able to run > > git branch --prune-merged master > > to clean up those topics that have been merged. Similarly I think it is > confusing that > > git checkout -b topic origin > > starts a branch from the default branch on origin, but if I run > > git branch --prune-merged origin > > to clean it up, it will clean up all the branches with an upstream on > origin, not just those whose upstream matches origin/HEAD. > > So I like the idea, but would prefer the arguments to --prune-merged to > be upstream branches, not remotes. We could support globs so that > > git branch --prune-merges 'origin/*' > > would clean up all the branches whose upstream is on origin if that is > useful. > > Thanks > > Phillip
Hi Phillip!
This seems like a big change. It almost becomes a different feature. Would be interesting to hear what others have to say as well.
Harald