Skip to content

Instantly share code, notes, and snippets.

@juandm
Last active November 22, 2019 19:56
Show Gist options
  • Save juandm/7ac9f184c0bd47439d6ed2249d4cdaba to your computer and use it in GitHub Desktop.
Save juandm/7ac9f184c0bd47439d6ed2249d4cdaba to your computer and use it in GitHub Desktop.
  1. Delete all local branchs except master and develop
git branch | grep -v "master\|develop" | xargs git branch -D
  1. Delete local refs to deleted remote branchs.

    • Verify branchs

      git branch -a
      
    • Delete refs

      git remote prune origin
      
    • Verify

      git branch -a
      
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment