Created
March 8, 2016 06:11
-
-
Save netsprout/53512a15d5d545f6f8ad to your computer and use it in GitHub Desktop.
Git Branch Cleanup Shell Aliases
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 cleanup | |
# remove remote branches merged into my local development | |
alias gitcleanupremote='git branch --merged development | grep -v "\*" | grep -v "master*" | grep -v "developoment" | xargs -I {} git push origin :{}' | |
# rename for deletion local branches merged into my local development | |
alias gitcleanup='git branch --merged development | grep -v "\*" | grep -v "master*" | grep -v "developoment" | xargs -I {} git branch -m {} "DELETEME-{}"' | |
# Delete branches marked for delete | |
alias gitdestroy='git branch | grep DELETEME- | xargs -n 1 git branch -d' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment