Skip to content

Instantly share code, notes, and snippets.

@mrhaw
Forked from ericelliott/gitclean.sh
Created June 13, 2016 23:09
Show Gist options
  • Save mrhaw/1c331a484903e36e3849063056369ef6 to your computer and use it in GitHub Desktop.
Save mrhaw/1c331a484903e36e3849063056369ef6 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