Created
October 9, 2017 10:14
-
-
Save apahim/6e33ddd6257c7628e084f3b04cab9d6a to your computer and use it in GitHub Desktop.
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 | |
if [ -z "${1}" ] | |
then | |
echo "Please provide usernam:branch of your fork." | |
exit 1 | |
else | |
fork_user=$(echo ${1} | cut -d ":" -f 1) | |
fork_branch=$(echo ${1} | cut -d ":" -f 2) | |
fi | |
if [ -z $fork_user -o -z fork_branch ] | |
then | |
echo "Please provide usernam:branch of your fork." | |
else | |
git fetch https://github.com/$fork_user/avocado.git $fork_branch | |
git checkout -b $fork_user-$fork_branch FETCH_HEAD | |
git checkout -b $fork_user-$fork_branch-test | |
git fetch upstream master | |
git rebase upstream/master | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment