Skip to content

Instantly share code, notes, and snippets.

@canassa
Created April 16, 2018 10:07
Show Gist options
  • Save canassa/a207c79a70937cbf647b5512e4990550 to your computer and use it in GitHub Desktop.
Save canassa/a207c79a70937cbf647b5512e4990550 to your computer and use it in GitHub Desktop.
Git cheatsheet
# Delete all branches that have been merged
git branch -r --merged | grep -v origin/master | sed 's/origin\///' | xargs git push origin --delete
# Get a list of git branches, ordered by most recent commit
git branch -r --sort=committerdate --format="%(refname:short) %(committerdate:short)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment