Skip to content

Instantly share code, notes, and snippets.

@adamlutz
Last active August 29, 2015 14:09
Show Gist options
  • Save adamlutz/085b16a80d949cf8908d to your computer and use it in GitHub Desktop.
Save adamlutz/085b16a80d949cf8908d to your computer and use it in GitHub Desktop.
GIT cheatsheet
# delete all remote origin branches that have been merged into master
git b -r --merged master | grep -v master | sed 's/origin\//:/' | xargs -n 1 git push origin
# delete all local branches merged into master
git branch --merged master | grep -v master | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment