-
-
Save masaru-b-cl/3753414 to your computer and use it in GitHub Desktop.
git-master
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 | |
WORKING_BRANCH=`git branch -l | grep "*" | cut -d " " -f 2` | |
IFS_ORIG=$IFS | |
IFS=# | |
arr=($WORKING_BRANCH) | |
IFS=$IFS_ORIG | |
size=${#arr[@]} | |
if test $size -eq 1 | |
then | |
MASTER=${1:-"master"} | |
else | |
MASTER=${1:-${arr[0]}} | |
fi | |
git rebase $MASTER && git checkout $MASTER && git reset --hard $WORKING_BRANCH && git branch -D $WORKING_BRANCH |
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 | |
MASTER=${1:-"master"} | |
WORKING_BRANCH=`git branch -l | grep "*" | cut -d " " -f 2` | |
git checkout $MASTER && git merge $WORKING_BRANCH --no-ff && git reset --hard $WORKING_BRANCH && git branch -D $WORKING_BRANCH |
ワーキングブランチ名がworking#feature
形式の場合、master
でなくworking
にrebase
する。
(see. https://gist.github.com/masaru-b-cl/5b461ffd4728ab9b61cb/)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rebaseによるffマージではなく、merge --no-ffオプションによるマージ版