All Posts

How to delete Multiple branches in Git?

November 15, 2020 • ☕️ 1 min read

To delete many branches based on a specified pattern do the following: Open the terminal, or equivalent.

Type in git branch | grep <pattern> for a preview of the branches that will be deleted.

preview branches

Type in git branch | grep <pattern> | xargs git branch -D

deleted branches

Replace the <pattern> with a regular expression to match your branch names and that’s it.

Thanks for reading :)


Relative Posts:

Callback function in javascript

November 9, 2020