Skip to content

Instantly share code, notes, and snippets.

@tsloughter
Created July 25, 2011 18:29
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 tsloughter/1104801 to your computer and use it in GitHub Desktop.
Save tsloughter/1104801 to your computer and use it in GitHub Desktop.
Remove all remote branches by pattern
for x in `git branch -r | grep "origin/reviewable-" `; do git push ${x%/*} :${x#*/}; done
@haridsv
Copy link

haridsv commented Dec 15, 2021

Avoid running git branch multiple times:

git branch -r | fgrep origin/reviewable- | while read x; do git push ${x%/*} :${x#*/}; done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment