Skip to content

Instantly share code, notes, and snippets.

@janbaer
Last active March 4, 2016 12:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janbaer/3c08a2039c1363dce2ba to your computer and use it in GitHub Desktop.
Save janbaer/3c08a2039c1363dce2ba to your computer and use it in GitHub Desktop.
Purges all remote deleted feature branches locally
function Git-Purge () {
  git fetch -p | git branch --color=never --merged | grep -v "\*" | grep -v "master" | grep -v "develop" | xargs -n 1 git branch -d
}
@janbaer
Copy link
Author

janbaer commented Mar 4, 2016

I just update the git branch part with the --color=never arguments because of problems with the color ansi codes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment