Skip to content

Instantly share code, notes, and snippets.

@mkyed
Last active November 7, 2022 08:21
Show Gist options
  • Save mkyed/ac2da3440b32f8bf49d1fce7cc80a686 to your computer and use it in GitHub Desktop.
Save mkyed/ac2da3440b32f8bf49d1fce7cc80a686 to your computer and use it in GitHub Desktop.
Delete git branches that have no difference to master
git branch | grep -v master | while read b; do test 0 -eq `git diff origin/$b $b 2>/dev/null | wc -l` && git branch -D $b; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment