Re: [RFC] branch: delete gone-upstream branches only when proven merged into a named ref
- From
Harald Nordgren <haraldnordgren@gmail.com>
- Date
- Oct 24, 2026, 18:23 UTC
- Message-ID
- <CAHwyqnU5abc_KL-R__7G=PU8hGAaRGrXwZLuCkMJE0qoEFfKUQ@mail.gmail.com>
- In-Reply-To
- <ba149000e13634ffcc5dc51e4d584a56@donquinleone.com>
Show 13 quoted lines
> D. Ben Knoble wrote:
> > In this case, if "topic@{upstream}" was "origin/master", though,
> > "--delete-merged=origin/*" would work, no?
>
> Yes. With push.default=current, "git switch -c topic origin/master"
> and a plain "git push origin topic", the dry run offers to delete topic
> once the pull request is merged, with no code change at all. So the gap
> is only for people who follow the hosting services' advice and run
> "git push -u", which points @{upstream} at the topic's own remote
> branch. That's the setup I'd hoped to help, and I suspect it's a common
> one, but I agree the better long-term fix there is teaching the
> triangular setup. A document like the one you mentioned would be very
> welcome.FWIW, I still regard "squash merge" as part of a triangular workflow, since GitHub's PRs are inherently triangular.
Harald