Skip to content

Instantly share code, notes, and snippets.

@jabarihunt
Last active November 15, 2023 14:36
Show Gist options
  • Save jabarihunt/80f0456374a679ac1747646c695c119a to your computer and use it in GitHub Desktop.
Save jabarihunt/80f0456374a679ac1747646c695c119a to your computer and use it in GitHub Desktop.
Delete All Release Branches
# Deletes all local AND remote release branches
git branch -D `git branch --list 'release/*'` && git push origin --delete `git branch --list 'release/*'`
# Works great as a package.json, composer.json, etc script...
"scripts": {
"delete-release-branches": "git branch -D `git branch --list 'release/*'` && git push origin --delete `git branch --list 'release/*'`"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment