summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeandro Lucarella <leandro.lucarella@sociomantic.com>2014-10-01 12:02:48 +0200
committerMihails Strasuns <mihails.strasuns@sociomantic.com>2014-10-01 14:08:39 +0200
commitda29881cec994f853239dc72af38c87df4618527 (patch)
tree3d6e6c7ba150d8625f079b5a7a01a6d0d6ee7392
parent53bb36e69ebabd42e097928000ca78028467ccc5 (diff)
Properly set hub.forkremote when using clone -t
When using the triangular workflow, git-hub should push to the fork instead of origin when creating new pull requests, and for this hub.forkremote has to be properly set. Fixes #106.
-rwxr-xr-xgit-hub1
-rw-r--r--man.rst4
2 files changed, 3 insertions, 2 deletions
diff --git a/git-hub b/git-hub
index 0272a21..235a93e 100755
--- a/git-hub
+++ b/git-hub
@@ -763,6 +763,7 @@ class CloneCmd (object):
if triangular:
remote_url = repo[config.urltype]
git_config('remote.pushdefault', prefix='', value=remote)
+ git_config('forkremote', value=remote)
git_config('upstream', value=upstream)
git('remote', 'add', remote, remote_url)
infof('Fetching from {} ({})', remote, remote_url)
diff --git a/man.rst b/man.rst
index 02d2fe3..0e075d5 100644
--- a/man.rst
+++ b/man.rst
@@ -91,8 +91,8 @@ COMMANDS
\-t, --triangular
Use Git's *triangular workflow* configuration. This option clones from the
parent/upstream repository instead of cloning the fork, and adds the fork
- as a remote repository. Then sets the `remote.pushdefault` Git option to
- the fork.
+ as a remote repository. Then sets the `remote.pushdefault` Git option and
+ `hub.forkremote` git-hub option to the fork.
The effect of this having the upstream repository used by default
when you pull but using your fork when you push, which is typically what