Last active
February 18, 2016 02:59
-
-
Save NPoi/20b1fd4626dcbdddb9fa to your computer and use it in GitHub Desktop.
リモートでマージされてるリモートブランチとローカルブランチを削除するgitサブコマンドのつもり
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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