Last active
August 6, 2017 22:24
-
-
Save HollyPony/5c1b2167ef41d6f6f6d358df217a9664 to your computer and use it in GitHub Desktop.
Some git tricks
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
# List local merged branches excluding master && develop | |
git branch --merged | egrep -v "(^\*|master|develop)" | |
# Remove local merged branches | |
git branch --merged | grep -v master | xargs git branch -d | |
# Remove all distant merged branches | |
git branch -r --merged remotes/origin/master | grep -v master | sed 's/origin\///' | xargs -n 1 git push --delete origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment