Skip to content

Instantly share code, notes, and snippets.

@tjunghans
Created March 3, 2020 14:53
Show Gist options
  • Save tjunghans/152a49d23c0706d3077b192b0621c225 to your computer and use it in GitHub Desktop.
Save tjunghans/152a49d23c0706d3077b192b0621c225 to your computer and use it in GitHub Desktop.
Git Branch Unix Tools

Remove GIT Branch

Removing branches with the following name convention:

bugfix/

# use -D to force delete
git branch | grep "^  feature" | xargs git branch -d

feature/

# The space between ^ and feature is to include the indentation without the current branch which has a *
git branch | grep "^  feature" | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment