Skip to content

Instantly share code, notes, and snippets.

@robatwilliams
Created November 3, 2017 17:30
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 robatwilliams/ed25a263cb0868321b5b67277f181409 to your computer and use it in GitHub Desktop.
Save robatwilliams/ed25a263cb0868321b5b67277f181409 to your computer and use it in GitHub Desktop.
Delete old local Git branches
# manually
git remote update origin --prune
git branch -vv | grep "gone]"
git branch -d theBranchName anotherBranch andAnotherBranch
# automatically
git branch -vv | grep "gone]" | awk '{print $1}' | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment