Last active
August 29, 2015 14:06
-
-
Save djmccormick/4ec1d73392d2fd72df47 to your computer and use it in GitHub Desktop.
A quick shell script to clean up merged branches both locally and on origin, plus prune local branches
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
#!/bin/sh | |
git checkout master | |
git remote update --prune | |
git branch -r --merged | grep -v master | grep -v develop | sed -e 's/origin\//:/' | xargs git push origin | |
git branch --merged | grep -v master | grep -v develop | xargs git branch -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment