Skip to content

Instantly share code, notes, and snippets.

@billypchan
Last active January 13, 2022 15:24
Show Gist options
  • Save billypchan/cd496d1cb17543516bf8c042f482d274 to your computer and use it in GitHub Desktop.
Save billypchan/cd496d1cb17543516bf8c042f482d274 to your computer and use it in GitHub Desktop.
Clean up all bump PR branches
##clean up all remote branches with name "chore/bump_*"
cleanGitBranch.sh
git branch -r --sort=-committerdate --list 'origin/chore/bump_*' | sed "s/origin\///" | xargs -I {} git push origin --delete {}
@billypchan
Copy link
Author

output when running on wire-ios repo:

bill@Air wire-ios % git branch -r --sort=-committerdate --list 'origin/chore/bump_*' | sed "s/origin\///" | xargs -I {} git push origin --delete {}

To https://github.com/wireapp/wire-ios
 - [deleted]             chore/bump_2022-01-11-094928
To https://github.com/wireapp/wire-ios
 - [deleted]             chore/bump_2022-01-10-220648
To https://github.com/wireapp/wire-ios
 - [deleted]             chore/bump_2021-12-09-142453
To https://github.com/wireapp/wire-ios
 - [deleted]             chore/bump_2021-12-08-103646
To https://github.com/wireapp/wire-ios
 - [deleted]             chore/bump_2021-10-25-131923
To https://github.com/wireapp/wire-ios
 - [deleted]             chore/bump_2021-10-25-130216

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