Skip to content

Instantly share code, notes, and snippets.

@HollyPony
Last active August 6, 2017 22:24
Show Gist options
  • Save HollyPony/5c1b2167ef41d6f6f6d358df217a9664 to your computer and use it in GitHub Desktop.
Save HollyPony/5c1b2167ef41d6f6f6d358df217a9664 to your computer and use it in GitHub Desktop.
Some git tricks
# 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