Skip to content

Instantly share code, notes, and snippets.

@AlexanderRD
Created November 30, 2017 11:36
Show Gist options
  • Save AlexanderRD/dc9ebda16fa76a1477aa8101ecf518a2 to your computer and use it in GitHub Desktop.
Save AlexanderRD/dc9ebda16fa76a1477aa8101ecf518a2 to your computer and use it in GitHub Desktop.
Local dev gihub branch clean-up
#Only delete branches merged into their upstream origins
git branch | grep -v "master" | grep -v "release" | xargs -n 1 git branch -d
# Delete branch regardless of merge status
git branch | grep -v "master" | grep -v "release" | xargs -n 1 git branch -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment