Created
October 3, 2013 03:37
-
-
Save DekusDenial/6804524 to your computer and use it in GitHub Desktop.
First, clone your forked repo.
Second, set remote upstream to be the repo your repo forking from.
Last, rebase the current HEAD with the remote HEAD
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
#!/usr/bin/env sh | |
repo=$( echo $1 | sed -E 's/^.*\///' | sed -E 's/\.git//' ) | |
echo "\n<<<<<<<<< Cloning [${repo}] from [${1}] >>>>>>>>>" | |
T1=$(date +%s) | |
git clone $1 && cd $repo | |
HEAD=$( git rev-parse --abbrev-ref HEAD ) | |
echo "\n<<<<<<<<< Adding [${2}] as upstream remote >>>>>>>>>" | |
git remote add upstream $2 | |
echo "\n<<<<<<<<< Rebase [${HEAD}] from remote upstream >>>>>>>>>" | |
git fetch upstream && git checkout ${HEAD} | |
git rebase upstream/${HEAD} | |
T2=$(date +%s) | |
echo "\n<<<<<<<<<< Took $(($T2 - $T1))s >>>>>>>>>>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment