# defined behaviour for multiple urls for a remote

4 messages from 2011-10-14 to 2011-10-17. Participants: Sitaram Chamarty, Kirill Likhodedov.
Thread: https://gitlist.dev/t/28671

## Sitaram Chamarty, 2011-10-14 07:07

Subject: defined behaviour for multiple urls for a remote
Message-ID: <CAMK1S_jZJuqC6_-eVT7LJFh+DEphbsypS6f4nRb6Qc4-xBa_wQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAMK1S_jZJuqC6_-eVT7LJFh%2BDEphbsypS6f4nRb6Qc4-xBa_wQ%40mail.gmail.com

```
Hi,

What's the defined behaviour if I do this:

[remote "both"]
	url = https://code.google.com/p/gitolite/
        url = git@github.com:sitaramc/gitolite.git

I know what I'm seeing (a fetch only goes to the first URL, and does a
HEAD->FETCH_HEAD because I didn't provide a refspec line, while a push
seems to push all to both), but I was curious what the official
position is, because I couldn't find it in the docs.

-- 
Sitaram

```

## Kirill Likhodedov, 2011-10-14 09:36

Subject: Re: defined behaviour for multiple urls for a remote
Message-ID: <loom.20111014T113208-660@post.gmane.org>
URL: https://gitlist.dev/e/loom.20111014T113208-660%40post.gmane.org
In-Reply-To: <CAMK1S_jZJuqC6_-eVT7LJFh+DEphbsypS6f4nRb6Qc4-xBa_wQ@mail.gmail.com>

```
Sitaram Chamarty <sitaramc <at> gmail.com> writes:

> What's the defined behaviour if I do this:
> 
> [remote "both"]
> 	url = https://code.google.com/p/gitolite/
>         url = git <at> github.com:sitaramc/gitolite.git
> 
> I know what I'm seeing (a fetch only goes to the first URL, and does a
> HEAD->FETCH_HEAD because I didn't provide a refspec line, while a push
> seems to push all to both), but I was curious what the official
> position is, because I couldn't find it in the docs.

Please see the message from Linus about that: http://marc.info/?l=git&m=116231242118202&w=2

You also may check how Git understands your remotes by running
  git remote -v
It will show, where it is going to fetch from and push to.

I agree though, that documentation should be updated.

```

## Sitaram Chamarty, 2011-10-14 14:01

Subject: Re: defined behaviour for multiple urls for a remote
Message-ID: <CAMK1S_jW5Fgv7j2w=xu8MMe_gaFFZNe+W4+Bvf1OrMR2rXQhCQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAMK1S_jW5Fgv7j2w%3Dxu8MMe_gaFFZNe%2BW4%2BBvf1OrMR2rXQhCQ%40mail.gmail.com
In-Reply-To: <loom.20111014T113208-660@post.gmane.org>

```
On Fri, Oct 14, 2011 at 3:06 PM, Kirill Likhodedov
<Kirill.Likhodedov@jetbrains.com> wrote:
> Sitaram Chamarty <sitaramc <at> gmail.com> writes:
>
>> What's the defined behaviour if I do this:
>>
>> [remote "both"]
>>       url = https://code.google.com/p/gitolite/
>>         url = git <at> github.com:sitaramc/gitolite.git
>>
>> I know what I'm seeing (a fetch only goes to the first URL, and does a
>> HEAD->FETCH_HEAD because I didn't provide a refspec line, while a push
>> seems to push all to both), but I was curious what the official
>> position is, because I couldn't find it in the docs.
>
> Please see the message from Linus about that: http://marc.info/?l=git&m=116231242118202&w=2

cool; thanks!

> You also may check how Git understands your remotes by running
>  git remote -v

Aah that's very clear!

> It will show, where it is going to fetch from and push to.
>
> I agree though, that documentation should be updated.

well if it never came up once in the 5 years since Linus wrote that email... :-)

```

## Sitaram Chamarty, 2011-10-17 03:41

Subject: Re: defined behaviour for multiple urls for a remote
Message-ID: <CAMK1S_jzMKqA2SQR_q+5xjG_-CFM86cL0QaGvx-TA_sBC=Vh+g@mail.gmail.com>
URL: https://gitlist.dev/e/CAMK1S_jzMKqA2SQR_q%2B5xjG_-CFM86cL0QaGvx-TA_sBC%3DVh%2Bg%40mail.gmail.com
In-Reply-To: <loom.20111014T113208-660@post.gmane.org>

```
On Fri, Oct 14, 2011 at 3:06 PM, Kirill Likhodedov
<Kirill.Likhodedov@jetbrains.com> wrote:
> Sitaram Chamarty <sitaramc <at> gmail.com> writes:
>
>> What's the defined behaviour if I do this:
>>
>> [remote "both"]
>>       url = https://code.google.com/p/gitolite/
>>         url = git <at> github.com:sitaramc/gitolite.git
>>
>> I know what I'm seeing (a fetch only goes to the first URL, and does a
>> HEAD->FETCH_HEAD because I didn't provide a refspec line, while a push
>> seems to push all to both), but I was curious what the official
>> position is, because I couldn't find it in the docs.
>
> Please see the message from Linus about that: http://marc.info/?l=git&m=116231242118202&w=2

cool; thanks!

> You also may check how Git understands your remotes by running
>  git remote -v

Aah that's very clear!

> It will show, where it is going to fetch from and push to.
>
> I agree though, that documentation should be updated.

well in theory yes, but now that you mention it, 'git remote -v' is sufficient.

```
