Skip to content

Instantly share code, notes, and snippets.

@deckerego
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deckerego/26bbd9a854b5897c4112 to your computer and use it in GitHub Desktop.
Save deckerego/26bbd9a854b5897c4112 to your computer and use it in GitHub Desktop.
Remove Stale Git Branches
# Find branches already merged
git branch -a --merged
# Find a list of branches by date and author
git for-each-ref --sort=committerdate --format='%(committerdate:short) %(authorname) %(refname:short)' | grep "origin"
# Prune your locally cloned version
git fetch -p
git gc --prune=now
git remote prune origin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment