Skip to content

Instantly share code, notes, and snippets.

@dva
Last active January 3, 2016 11:09
Show Gist options
  • Select an option

  • Save dva/8454408 to your computer and use it in GitHub Desktop.

Select an option

Save dva/8454408 to your computer and use it in GitHub Desktop.
Git Flow: Remove feature branches which are merged.
#!/bin/sh
#
# Remove feature branches which are merged.
#
OLD_BRANCH=`git branch | awk '/\*/{ print $2 }'`
git checkout develop
git branch --merged | awk '/feature/{ print $1 }' | xargs git branch -d {}
git checkout $OLD_BRANCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment