Re: Potential problems with url.<base>.insteadOf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Javier Mora <cousteaulecommandant@xxxxxxxxx> writes:

> The choice of `url.<replacement>.insteadOf <original>` as a way to
> replace URLs is not only a bit confusing, as it has already been
> discussed[1], but also presents some problems and makes it impossible
> to achieve certain configurations.
> [1] https://public-inbox.org/git/20181122173109.GI28192@xxxxxxxxxxxxxxxxxxxxx/
>
> SCENARIO 1:
> I want to replace all references to the (now defunct)
> 'http://example.org/' to the new server, 'http://example.com/'.
>
> OK, that is easy (even if a bit counter-intuitive).  Just do:
> git config url.'http://example.com/'.insteadOf 'http://example.org/'
>
> SCENARIO 2:
> I want to replace BOTH 'http://example.org/' and 'http://example.net/'
> with 'http://example.com/'.

So, you want to end up with

    [url "http://example.com/";]
	insteadOf = http://example.org
	insteadOf = http://example.net

but you cannot get there with only "git config VARIABLE VALUE",
because that syntax is used to clear the existing values for
VARIRABLE before setting it to VALUE.

Have you tried

    $ git config url.http://example.com/.insteadof http://example.org

that clears existing values for url.http://example.com/.insteadof
and sets it to "http://example.org";, then immediately follow it with

    $ git config --add url.http://example.com/.insteadof http://example.net

that keeps existing values for url.http://example.com/.insteadof
and adds another value to the same variable?





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux