Created
June 8, 2016 18:02
-
-
Save umegaya/1cfe1304b1fe1b34babf27fec52c809b to your computer and use it in GitHub Desktop.
自分の作業用のブランチをmasterに追随させるスクリプト
This file contains hidden or 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/bash | |
dst=$1 | |
src=$2 | |
if [ -z "$dst" ]; then | |
echo "usage: ./follow_branch.sh dst src(or master when omitted)" | |
exit 1 | |
fi | |
if [ -z "$src" ]; then | |
src=master | |
fi | |
echo "follow $dst to $src" | |
git reset --hard | |
git clean -d -f | |
git checkout $src | |
git pull | |
git checkout $dst | |
git pull | |
git rebase $src | |
git push origin -f $dst:$dst | |
echo "done!!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment