Last active
May 17, 2016 18:39
-
-
Save IslamAzab/242103318c30c28be45b 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
# remove all merged branches except "develop" branch | |
git branch -r --merged | grep -v master | grep -v '^ develop$' | sed 's/origin\///' | xargs -n 1 git push --delete origin | |
# to remove them | |
git branch -r --merged | grep -v master | grep -v '^ development$' | sed -e 's/origin\///' | xargs -n 1 git branch --delete | |
# track all remote branches locally | |
for remote in `git branch -r | grep -v /HEAD`; do git checkout --track $remote ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment