Skip to content

Instantly share code, notes, and snippets.

@vczb
Created December 16, 2021 14:48
Show Gist options
  • Select an option

  • Save vczb/6347a4882dc9c251464a0514e9bab59c to your computer and use it in GitHub Desktop.

Select an option

Save vczb/6347a4882dc9c251464a0514e9bab59c to your computer and use it in GitHub Desktop.
Delete all local branches
git for-each-ref --format '%(refname:short)' refs/heads | grep -v "master\|stg1\|stg2\|stg3" | xargs git branch -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment