Skip to content

Instantly share code, notes, and snippets.

@devxoul
Last active February 4, 2022 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devxoul/72adcb880b273a36420d to your computer and use it in GitHub Desktop.
Save devxoul/72adcb880b273a36420d to your computer and use it in GitHub Desktop.
Git Prune Off: Delete merged branches.
#!/bin/bash
# https://gist.githubusercontent.com/devxoul/72adcb880b273a36420d/raw/git-pruneoff
# Delete merged branches.
git branch --merged | awk '{if($1 != "*" && ($1 != "master" || $1 != "main")) print $1}' | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment