Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nmccready
Created May 15, 2018 22:48
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 nmccready/a5c461cb9f0a5f616ad7941bbe4b3695 to your computer and use it in GitHub Desktop.
Save nmccready/a5c461cb9f0a5f616ad7941bbe4b3695 to your computer and use it in GitHub Desktop.
clean your remote branches
#!/bin/sh
#http://stackoverflow.com/questions/6127328/how-can-i-delete-all-git-branches-which-have-been-merged
git branch -r --merged origin/master | grep -v "^.*master" | grep nmccready | sed s:origin/:: |xargs -n 1 git push --delete origin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment