From: Harald Nordgren Date: Sat, 11 Jul 2026 19:36:35 GMT Subject: Re: [PATCH v18 5/7] branch: add --delete-merged Message-ID: In-Reply-To: > > > + ( > > > + cd repo && > > > + git checkout -b mainline main && > > > + git checkout -b on-local mainline && > > > + git branch --set-upstream-to=mainline on-local && > > > > Why do we need on-local to track mainline rather than main? I'm a bit > > confused what the point of mainline is. > > It's to have an indirection of a branch that is the same as main but > will be protected. I tried to delete it now and replace it with just > main, but then main was deleted and subsequent tests failed. Digging more into this, probably the most elegant solution is to replace mainline with main, but then also do this: git config branch.main.pushRemote origin This exposes something that I don't love about this feature, which is that when using a pushDefault (like we do in the tests with 'git config remote.pushDefault fork') if not adding a special case for the main/master branch (like 'git config branch.main.pushRemote origin'), then it will get cleaned up as a forked branch. But there was a lot of discussion about this already, so I won't get into this again. Harald