Skip to content

Instantly share code, notes, and snippets.

@zol
Created May 2, 2014 19:29
Show Gist options
  • Save zol/62c772d94d33581b9ab6 to your computer and use it in GitHub Desktop.
Save zol/62c772d94d33581b9ab6 to your computer and use it in GitHub Desktop.
Remove branches from origin that have been merged into master except devel
git fetch
git checkout master
git branch --merged | grep -v "\*" | grep -v devel | xargs -n 1 git push --delete origin
# this last step is for colleagues to clean up their local tracking branches
git remote prune origin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment