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

Re: Per-remote tracking branch

From
Jeff King <peff@peff.net>
Date
Sep 24, 2009, 06:29 UTC
Message-ID
<20090924062911.GC24486@coredump.intra.peff.net>
In-Reply-To
<vpq4or48bux.fsf@bauges.imag.fr>
On Tue, Sep 15, 2009 at 05:29:58PM +0200, Matthieu Moy wrote:
> Is there a way, with Git, to specify a tracking branch on a per-remote
> basis?

I don't think so, and I'm not sure there is an easy way to extend the current configuration scheme. Adding multiple config options like this:

  [branch "master"]
    remote = origin
    merge = refs/heads/master
    remote = alternate
    merge = refs/heads/master

looks a bit hack-ish to me, as there is an implicit correlation between the ordering of 'merge' entries and 'remote' entries.

And it feels a little backwards. When I say "git pull foo", I would find it equally likely to discover the pulled branch under "remote.foo" as it would to find it under "branch.master". Of course, in either case, you have to combine the context (current branch _and_ selected remote) to come up with the actual information. So I guess either is "equally correct" in a sense.

Anyway, mostly just my idle speculation.
-Peff
Previous: Matthieu MoyNext: Matthieu Moy
Message 2 of 6 in “Per-remote tracking branch”
  1. Matthieu MoySep 15, 2009
  2. Jeff KingSep 24, 2009
  3. Matthieu MoySep 24, 2009
  4. Björn SteinbrinkSep 24, 2009
  5. Björn SteinbrinkSep 24, 2009
  6. Matthieu MoySep 24, 2009

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.