Posted by spencerldixon 13 hours ago
Have a merge workflow which deletes the branch right there.
function Remove-GitBranches {
git branch --merged | Out-GridView -Title "Branches to Remove?" -OutputMode Multiple | % { git branch -d $_.Trim() }
}
`Out-GridView` gives you a quick popup dialog with all the branch names that supports easy multi-select. That way you get a quick preview of what you are cleaning up and can skip work in progress branch names that you haven't committed anything to yet.I have replaced my standard ddg of, "git <the thing i need>" with asking Claude to give me the commands I need to run.
alias git-wipe-merged-branches='git branch --merged | grep -v \* | xargs git branch -D'
Trying to remember where I got that one, as I had commented the following version out: alias git-wipe-all-branches='git for-each-ref --format '%(refname:short)' refs/heads | grep -v master | xargs git branch -D'https://github.com/tkrajina/git-plus
Disclaimer, I'm the author ^^