Mass remove git branches
To mass remove git branches from a git repository, you can use the following commands:
git branch | grep 'fewald' | xargs git branch -D
This command does the following:
-
git branch: Lists all local branches in the repository. -
grep 'fewald': Filters the list of branches to only include those that contain the string ‘fewald’. -
xargs git branch -D: Passes the filtered list of branches to thegit branch -Dcommand, which forcefully deletes each branch.