threads / discuss / 7047

Many different remote branch sources

Subject: Many different remote branch sources

## tl;dr

3 messages between Mar 2, 2007 and Mar 2, 2007.

replies: 2people: 2as markdown or json

Alex Riesen· Mar 2, 2007, 10:53 UTC · lore
The following does not seem to work:
  [remote "dev1"]
    url = ...
    fetch = ...
  [remote "dev2"]
    url = ...
    fetch = ...
  [branch "integration"]
    remote = dev1
    merge = refs/heads/topic1
  [branch "integration"]
    remote = dev2
    merge = refs/heads/topic2

How can I specify that a branch has more then one remote branch it can be merged with?

Johannes Schindelin· Mar 2, 2007, 15:47 UTC · re: Alex Riesen · lore

Re: Many different remote branch sources

Hi,
On Fri, 2 Mar 2007, Alex Riesen wrote:
Show 19 quoted lines
> The following does not seem to work:
> 
>  [remote "dev1"]
>    url = ...
>    fetch = ...
>  [remote "dev2"]
>    url = ...
>    fetch = ...
> 
>  [branch "integration"]
>    remote = dev1
>    merge = refs/heads/topic1
> 
>  [branch "integration"]
>    remote = dev2
>    merge = refs/heads/topic2
> 
> How can I specify that a branch has more then one
> remote branch it can be merged with?

The branch.<branchname> information is purely for determining what you want to do when saying "git pull" (without other arguments).

In your case, I'd strongly advise against using this construct, since you don't want to merge with dev1 and dev2 _at the same time_.

Rather, add a "fetch = refs/heads/topic1" at the _top_ of the remotes.dev1 section, and say "git pull dev1" when you want to pull from dev1.

Ciao, Dscho

Alex Riesen· Mar 2, 2007, 22:18 UTC · re: Johannes Schindelin · lore

Re: Many different remote branch sources

On 3/2/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Rather, add a "fetch = refs/heads/topic1" at the _top_ of the remotes.dev1
> section, and say "git pull dev1" when you want to pull from dev1.

This is exactly what I wanted. I just somehow believed that git pull uses only references configured in branch sections, never the references in "remote" sections. Am a bit confused.

← back to recent threads