Can you delete multiple branches in one command with Git?

Not with that syntax. But you can do it like this:

git branch -D 3.2 3.2.1 3.2.2

Basically, git branch will delete multiple branch for you with a single invocation. Unfortunately it doesn’t do branch name completion. Although, in bash, you can do:

git branch -D `git branch | grep -E '^3\.2\..*'`

Leave a Comment