Skip to content

Instantly share code, notes, and snippets.

@smohammadhn
Created April 22, 2024 15:15
Show Gist options
  • Save smohammadhn/256786b34756f691717c1bf0d5fbbd27 to your computer and use it in GitHub Desktop.
Save smohammadhn/256786b34756f691717c1bf0d5fbbd27 to your computer and use it in GitHub Desktop.
Git delete all merged branches locally (except main and develop)
git branch --merged | egrep -v "(^\*|main|develop)" | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment