Skip to content

Instantly share code, notes, and snippets.

@edoardottt
Created October 1, 2022 08:46
Show Gist options
  • Save edoardottt/30b003066c7b2fd8a9164146bf013ba8 to your computer and use it in GitHub Desktop.
Save edoardottt/30b003066c7b2fd8a9164146bf013ba8 to your computer and use it in GitHub Desktop.
# If you want to delete all local branches that are already merged into master, you can use the following command:
# ref: https://stackoverflow.com/questions/13064613/how-to-prune-local-tracking-branches-that-do-not-exist-on-remote-anymore
git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment