Skip to content

Instantly share code, notes, and snippets.

@vincentclaes
Last active December 15, 2020 18:58
Show Gist options
  • Save vincentclaes/13b807a670a1d115f31a51b2315194dd to your computer and use it in GitHub Desktop.
Save vincentclaes/13b807a670a1d115f31a51b2315194dd to your computer and use it in GitHub Desktop.
# remove all local branches except for master
git branch | grep -v "master" | xargs git branch -d
git branch | grep -v "main" | xargs git branch -d
# fetch objects and prune; delete the ones that you cannot reach.
git fetch -pv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment