Skip to content

Instantly share code, notes, and snippets.

@alejandrofloresm
Created July 16, 2017 17:40
Show Gist options
  • Save alejandrofloresm/4c3b15d3731aa4b3fc4f3a9b99be44de to your computer and use it in GitHub Desktop.
Save alejandrofloresm/4c3b15d3731aa4b3fc4f3a9b99be44de to your computer and use it in GitHub Desktop.
Delete your local branches that are not on the remote.
# Shows the branches that should be deleted
# Resource: https://kparal.wordpress.com/2011/04/15/git-tip-of-the-day-pruning-stale-remote-tracking-branches/
git remote prune origin --dry-run
# Deletes the branches
git remote prune origin
# It can also be done with fetch
git fetch origin --prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment