Created
September 15, 2014 14:16
-
-
Save tarto-dev/d64c2360b7191e059f90 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 checkout develop | |
| git fetch | |
| git remote prune origin | |
| #Remove locally | |
| git branch --merged develop | grep -v 'develop$' | xargs git branch -d | |
| echo "Branches merged, to delete:" | |
| git branch -r --merged develop | sed 's/ *origin\///' | grep -v 'develop$' | |
| read -p "Sure about that (y/n)? " | |
| if [ "$REPLY" == "y" ] | |
| then | |
| #Remove remotely | |
| git branch -r --merged develop | sed 's/ *origin\///' \ | |
| | grep -v 'develop$' | xargs -I% git push origin :% | |
| echo "Done!" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment