Skip to content

Instantly share code, notes, and snippets.

@mgrahamjo
Created August 24, 2021 15:44
Show Gist options
  • Save mgrahamjo/51be9fb82e52f9020632551f69680738 to your computer and use it in GitHub Desktop.
Save mgrahamjo/51be9fb82e52f9020632551f69680738 to your computer and use it in GitHub Desktop.
Deletes all local branches that have been pushed to the remote
git branch -r | grep -v origin/main | sed 's#origin/##' | xargs git branch -D 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment