Skip to content

Instantly share code, notes, and snippets.

@umegaya
Created June 8, 2016 18:02
Show Gist options
  • Save umegaya/1cfe1304b1fe1b34babf27fec52c809b to your computer and use it in GitHub Desktop.
Save umegaya/1cfe1304b1fe1b34babf27fec52c809b to your computer and use it in GitHub Desktop.
自分の作業用のブランチをmasterに追随させるスクリプト
#!/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