Created
February 8, 2016 20:16
-
-
Save kblok/a1d4d0d56bc8fb0f7be7 to your computer and use it in GitHub Desktop.
Remove remote branches already merged into develop
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
| #!/bin/bash | |
| git fetch origin | |
| git checkout develop | |
| git pull upstream develop | |
| git branch -r --merged develop | grep -v "origin/master$" | grep -v "origin/develop$" | grep "origin/*" | sed 's/\s*origin\///' | xargs -t -n 1 git push --delete origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment