Re: Per-remote tracking branch
From: Matthieu Moy <hidden>
Date: 2016-06-15 22:47:26
Hi, and thanks for your answer, Jeff King [off-list ref] writes:
On Tue, Sep 15, 2009 at 05:29:58PM +0200, Matthieu Moy wrote:quoted
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 ;-).
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/