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/