Skip to content

Instantly share code, notes, and snippets.

@nikolazic
Last active July 25, 2016 22:41
Show Gist options
  • Save nikolazic/dbeb648de56d623f2941ba007fcdcd03 to your computer and use it in GitHub Desktop.
Save nikolazic/dbeb648de56d623f2941ba007fcdcd03 to your computer and use it in GitHub Desktop.
Delete all remote/local branches merged into develop
Local
git branch --merged master | grep -v 'master$' | grep -v 'develop$' | xargs git branch -d
REMOTE!
git branch -r --merged origin/develop | grep -v master | grep -v develop | sed -e 's/\// :/' | xargs -n2 git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment