-
-
Save BenGitsCode/7db521aac61f45517b2b2e23c62f6cdb to your computer and use it in GitHub Desktop.
gitclean.sh - cleans merged/stale branches from origin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
more generic version credit due to @BerkeleyTrue https://github.com/BerkeleyTrue/dotfiles/blob/master/dotfiles/profile#L236
original source: https://gist.github.com/ericelliott/2271bd12736585175c85