Cannot override `remote.origin.url` with `-c` option

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

 



> Thank you for filling out a Git bug report!
> Please answer the following questions to help us understand your issue.

> What did you do before the bug happened? (Steps to reproduce your issue)

```
# Create a test repo to pull into
git init test
cd $_
git remote add origin wrong-url
# Create a test repo to pull from
git init ../test2
cd $_
touch a
git add .
git commit -m 'commit to pull'
# Attempt to pull, setting remote.origin.url
# The following git commands will fail:
cd ../test
git -c remote.origin.url=../test2 pull
git -c remote.origin.url=../test2 fetch
# However, this succeeds:
git pull ../test2
```


> What did you expect to happen? (Expected behavior)

The '-c' option should allow me to override the remote URL,
which, as a result of running `git remote add`, is configured as
follows in test/.git/config:

```
[remote "origin"]
	url = wrong-url
```


[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