My normal pattern is to branch from master, do a ton of work, then rebase and git svn dcommit. How can I clean up all my old branches?
Basically I want to find any branches that have git-svn-id: in the message and git branch -D those.
NOTE: git branch --no-color --no-track --merged gets me most of the way, but if I ever get into a situation where I need a git fetch -f (because of a crazy git-svn bug) I would have to go and rebase all the branches myself.
A sort-of-one-liner:
Note that this is untested; I don’t use git-svn, and it’s just based on the requirements in the second paragraph of your question. You might try it first with an echo in there instead of
git branch -D, to make sure the list of branches looks like what you’d expect. I can help refine it as necessary.