Thread (4 messages) flat view 4 messages, 2 authors, 2016-06-16

Re: [RFC/PATCH v2] pull: add --set-upstream

From: Erwan Mathoniere <hidden>
Date: 2016-06-16 02:19:47


On 06/06/2016 18:29, Philip Oakley wrote:
quoted
+ that each one tracks the remote branch pulled from. If a configuration
+ already exists, it is overwriten. For example, with `git pull -u origin
+ branch` the current branch will track `branch` from `origin`.
++
+If two or more branches are pulled on the same local branch, only the
last one
+in arguments will be tracked.
Is this specific to this pull --setupstream or a general worning ? i.e.
that a second entry is created in the config file, or that only the last
branch refspec will be added?
Only the last branch will be added. More precisely, its behavior is just 
like `git push --set-upstream`. If you do `git push --set-upstream 
master:master master:other`, git will change its configuration twice and 
will print out:

$ git push --set-upstream origin master:master master:other
[...]
Branch master set up to track remote branch master from origin.
Branch master set up to track remote branch other from origin.

And at the end, "master" will only track "other" from origin and both 
"branch.master.{merge, remote}" will be set once.
So for now, `git pull --set-upstream` does the same and for example, on 
master:

$ git pull --set-upstream origin master other
[...]
Branch master set up to track remote branch master from origin.
Branch master set up to track remote branch other from origin.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help