Skip to content

Instantly share code, notes, and snippets.

@gustavo-rodrigues-dev
Last active August 12, 2016 17:41
Show Gist options
  • Save gustavo-rodrigues-dev/4072b627ca7a0f98fa0c47ff789881bd to your computer and use it in GitHub Desktop.
Save gustavo-rodrigues-dev/4072b627ca7a0f98fa0c47ff789881bd to your computer and use it in GitHub Desktop.
GIT remove branchs by sufix or prefix

#Remove Branchs by GREP To delete one or more branchs based on prefix, suffix, reserved word or regular expression, just use the GREP together with the git branch.

##Keep Calm before to remove branchs test your grep comand, using list_branchs.sh

##Ref GREP - REGEX LIST

git branch -D `git branch | grep -E 'your_prefix*or_your_sufix'`
git branch | grep -E 'your_prefix*or_your_sufix'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment