Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save falehenrique/0b88811423cada2e520ddb8f5de14124 to your computer and use it in GitHub Desktop.
Save falehenrique/0b88811423cada2e520ddb8f5de14124 to your computer and use it in GitHub Desktop.
Remote a lot git remote branches
git branch -r | awk -F/ '/\/fix/{print $2"/"$3}' | xargs -I {} git push origin :{}
if you want list before, you can use it:
git branch -r | awk -F/ '/\/fix/{print $2"/"$3}'
In my case I want to delete all branches that start with the prefix "fix"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment