Last active
September 10, 2019 14:11
-
-
Save x-projs/2f05ca8f3bc3faa86c20cbd895a3608f to your computer and use it in GitHub Desktop.
Useful Git Commands
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
# Delete all remote tags. | |
git tag -l | xargs -n 1 git push --delete origin | |
# Delete all remote branches except master. | |
git branch -r | grep -v master | sed 's/origin\///' | xargs -n 1 git push --delete origin | |
# Delete all merged branches. | |
git branch -r --merged | 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