Created
January 16, 2012 11:32
-
-
Save asmega/1620431 to your computer and use it in GitHub Desktop.
delete remote merged git 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
git branch -r --merged develop | sed 's/ *phil\///' | grep -v 'master$' | grep -v 'develop$' | grep -v '^ dave' | grep -v '^ kevinbrowne' | xargs -I% git push phil :% | |
# mostly likely change the first part to master. use this branch to test if things have been merged in | |
# sed part. use this to remove the name of your remote in my case phil. most likely to be origin | |
# grep any branches you want to keep | |
# last part. change name to your remote | |
# you can do a dry run by removing the last section |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment