Skip to content

Instantly share code, notes, and snippets.

@frontenddeveloping
Forked from ericelliott/gitclean.sh
Created February 15, 2016 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frontenddeveloping/3ca5a3dd687566687d51 to your computer and use it in GitHub Desktop.
Save frontenddeveloping/3ca5a3dd687566687d51 to your computer and use it in GitHub Desktop.
gitclean.sh - cleans merged/stale branches from origin
git remote prune origin
git branch -r --merged master | egrep -iv '(master|develop)' | sed 's/origin\///g' | xargs -n 1 git push --delete origin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment