diff --git a/bin/git-fork b/bin/git-fork index 1294254..0981488 100755 --- a/bin/git-fork +++ b/bin/git-fork @@ -37,6 +37,7 @@ curl -X POST -u "$user" "https://api.github.com/repos/$owner/$project/forks" if [ "$origin" = true ]; then git remote rename origin upstream git remote add origin "https://github.com/$user/$project" + git fetch origin else # clone forked repo into current dir git clone "https://github.com/$user/$project" "$project" diff --git a/man/git-fork.1 b/man/git-fork.1 index c27cddb..e9e8043 100644 --- a/man/git-fork.1 +++ b/man/git-fork.1 @@ -19,7 +19,7 @@ forks the repo on github clones the repo into the current dir . .IP "3." 4 -adds the original repo as a remote called upstream +adds the original repo as a remote called \fBupstream\fR . .IP "" 0 . @@ -30,10 +30,10 @@ If a url is not given and the current dir is a github repo, fork the repo\. forks the current repo . .IP "2." 4 -rename the \'origin\' remote repo to \'upstream\' +rename the \fBorigin\fR remote repo to \fBupstream\fR . .IP "3." 4 -adds the forked repo as a remote called origin +adds the forked repo as a remote called \fBorigin\fR . .IP "" 0 . diff --git a/man/git-fork.html b/man/git-fork.html index e69de29..268c6c0 100644 --- a/man/git-fork.html +++ b/man/git-fork.html @@ -0,0 +1,150 @@ + + +
+ + +
+ git-fork - Fork a repo on github
+
git-fork [<github-repo-url>]
If a github repo url is given, fork the repo. Like clone but forks first.
+ +upstreamIf a url is not given and the current dir is a github repo, fork the repo.
+ +origin remote repo to upstreamoriginFork expect.js:
+ +$ git fork https://github.com/LearnBoost/expect.js
+
+
+or just:
+ +$ git fork LearnBoost/expect.js
+
+
+Then:
+ +$ ..<forks into your github profile and clones repo locally to expect.js dir>...
+
+$ cd expect.js && git remote -v
+
+ origin https://github.com/<user>/expect.js (fetch)
+ origin https://github.com/<user>/expect.js (push)
+ upstream https://github.com/LearnBoost/expect.js (fetch)
+ upstream https://github.com/LearnBoost/expect.js (push)
+
+
+If the current dir is a clone of expect.js, this has the same effect:
+ +$ git fork
+
+
+Written by Andrew Griffiths <mail@andrewgriffithsonline.com>
+ +<https://github.com/tj/git-extras/issues>
+ +<https://github.com/tj/git-extras>
+ + +