Created
April 17, 2014 21:43
-
-
Save Larusso/11013283 to your computer and use it in GitHub Desktop.
Clone a fork of a repository and setup the upstream remotes to follow the upstream repository.
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
git config --global alias.clone-fork '!sh -c "[ $# = 3 ] && git clone $1 $3 && cd $3 && git remote add upstream $2 && git fetch upstream && git checkout -b upstream_master --track upstream/master && git co @{-1} && exit 0 || echo \"usage: git clone-fork <fork-repository> <upstream-repository> <directory>\" >&2 && exit 1 "' - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment