Skip to content

Instantly share code, notes, and snippets.

@ssyrota
Last active October 9, 2022 15:02
Show Gist options
  • Save ssyrota/78c48eab24ac99a23921cca25d4e6d1e to your computer and use it in GitHub Desktop.
Save ssyrota/78c48eab24ac99a23921cca25d4e6d1e to your computer and use it in GitHub Desktop.
Remove git remote branches by pattern
git branch -r | awk -Forigin/ '/\/MOCKED_PATTERN/ {print $2}'\
| xargs -I {} git push origin :{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment