git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Erwan Mathoniere <erwan.mathoniere@grenoble-inp.org>
Date
Jun 7, 2016, 13:42 UTC
Message-ID
<eb423083-2574-45a7-ed78-4ebb75363141@grenoble-inp.org>
In-Reply-To
<2DE0829216C940168DCD804378CD18CC@PhilipOakley>
On 06/06/2016 18:29, Philip Oakley wrote:
Show 11 quoted lines
>> + 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.

Previous: Philip Oakley
Message 12 of 12 in “pull: set-upstream implementation”
  1. pull: set-upstream implementationErwan Mathoniere, May 25, 2016
  2. Junio C HamanoMay 25, 2016
  3. Erwan MathoniereMay 29, 2016
  4. pull: add --set-upstreamErwan Mathoniere, Jun 6, 2016
  5. Matthieu MoyJun 6, 2016
  6. Junio C HamanoJun 6, 2016
  7. Matthieu MoyJun 7, 2016
  8. Erwan MathoniereJun 7, 2016
  9. Erwan MathoniereJun 7, 2016
  10. Erwan MathoniereJun 7, 2016
  11. Philip OakleyJun 6, 2016
  12. Erwan MathoniereJun 7, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.