git remote联机帮助页非常简单:
使用
Older (backwards-compatible) syntax:
$ git remote rm upstream
Newer syntax for newer git versions: (* see below)
$ git remote remove upstream
Then do:
$ git remote add upstream https://github.com/Foo/repos.git
或直接更新网址:
$ git remote set-url upstream https://github.com/Foo/repos.git
或者,如果您对此感到满意,只需直接更新.git / config-您可能会发现需要更改的内容(留给读者练习)。
...
[remote "upstream"]
fetch = +refs/heads/*:refs/remotes/upstream/*
url = https://github.com/foo/repos.git
...
===
*关于'git remote rm'vs'git remote remove'-围绕git 1.7.10.3 / 1.7.12 2进行了更改-参见
https://code.google.com/p/git-core/source/detail?spec=svne17dba8fe15028425acd6a4ebebf1b8e9377d3c6&r=e17dba8fe15028425acd6a4ebebf1b8e9377d3c6
Log message
remote: prefer subcommand name 'remove' to 'rm'
All remote subcommands are spelled out words except 'rm'. 'rm', being a
popular UNIX command name, may mislead users that there are also 'ls' or
'mv'. Use 'remove' to fit with the rest of subcommands.
'rm' is still supported and used in the test suite. It's just not
widely advertised.
git remote remove upstream
产生“错误:未知子命令:删除”