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

Re: Per-remote tracking branch

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Sep 24, 2009, 11:10 UTC
Message-ID
<vpq63b8egy7.fsf@bauges.imag.fr>
In-Reply-To
<20090924062911.GC24486@coredump.intra.peff.net>
Hi, and thanks for your answer,
Jeff King <peff@peff.net> writes:
Show 13 quoted lines
> 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
I had tried this in case it would have worked ;-).
Show 5 quoted lines
> 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.

Actually, for my particular use case (aka "almost always only one branch per repo"), I could as well have a remote.foo.defaultBranch regardless of the current local branch. Then, if I say "git pull foo", it would understand it as "git pull foo <remote.foo.defaultBranch>".

If other people would be interested in such feature, say so, I may give it a try when I have time. If I'm the only one, I guess I'll let my fingers type the extra " master" instead ;-).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Jeff KingNext: Björn Steinbrink
Message 3 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.