Created
November 7, 2015 11:05
-
-
Save thecodejunkie/f1c5fdd30c97d8e0d766 to your computer and use it in GitHub Desktop.
Delete merged branches, both in origin and locally
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
1. Delete the branches in my remote `origin` | |
git branch -r --merged | grep "\origin" | grep -v "\master" | cut -d"/" -f 2 | xargs -n 1 git push origin --delete | |
2. Delete the branches locally | |
git branch --merged master | grep -v "\master" | xargs -n 1 git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would
-d
for the local delete be safer?