Skip to content

Instantly share code, notes, and snippets.

@x-projs
Last active September 10, 2019 14:11
Show Gist options
  • Save x-projs/2f05ca8f3bc3faa86c20cbd895a3608f to your computer and use it in GitHub Desktop.
Save x-projs/2f05ca8f3bc3faa86c20cbd895a3608f to your computer and use it in GitHub Desktop.
Useful Git Commands
# 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