Skip to content

Instantly share code, notes, and snippets.

@NPoi
Last active February 18, 2016 02:59
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 NPoi/20b1fd4626dcbdddb9fa to your computer and use it in GitHub Desktop.
Save NPoi/20b1fd4626dcbdddb9fa to your computer and use it in GitHub Desktop.
リモートでマージされてるリモートブランチとローカルブランチを削除するgitサブコマンドのつもり
#!/bin/sh
BRANCH=${1:-"development"}
git checkout ${BRANCH}
git pull
git remote prune origin
DEL_BRANCH=`git branch --merged | grep -v ${BRANCH} | grep -v \'*\'`
if [ -n "$DEL_BRANCH" ]
then
git branch -d $DEL_BRANCH
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment