Skip to content

Instantly share code, notes, and snippets.

@apahim
Created October 9, 2017 10:14
Show Gist options
  • Save apahim/6e33ddd6257c7628e084f3b04cab9d6a to your computer and use it in GitHub Desktop.
Save apahim/6e33ddd6257c7628e084f3b04cab9d6a to your computer and use it in GitHub Desktop.
#!/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