In Azure DevOps, my PR policy is set as "Semi-Linear", which means when you merge a pull request, it gets rebased first and then merged.
This makes it really difficult to clean up local branches because my normal git branch --merged origin/master
doesn't support this scenario.
How can I reliably determine, in bulk, which local branches have been "effectively merged" so that I may delete them?
Note: I have my push.default
set to current
, and I always keep my remote tracking branch set to origin/master
. So any solution that relies on checking upstream remote tracking branches for each local branch will not work (although, I do push my branches to the remote using the same name; we just can't rely on the remote tracking branch for that). I wanted to mention this detail just in case any solution would leverage remote tracking branches.
I found a similar SO question, Git: How do I list local branches that are tracking remote branches that no longer exist?, but it has no acceptable answers as far as I'm concerned.