git 添加 fetch url 到远程

git add fetch url to remote

在我的回购中我有以下情况:

$ git remote -v
origin  http://repoA/_git/libs (fetch)
origin  http://repoB/libs.git (push)
origin  http://repoA/_git/qpp_libs (push)

我也想从 repoB 中获取。这就是我想要实现的方式:

git remote set-url --add origin http://repoB/libs.git

但是在 运行 上面的命令之后仍然只有 3 URLs:

$ git remote -v
origin  http://repoA/_git/libs (fetch)
origin  http://repoB/libs.git (push)
origin  http://repoA/_git/qpp_libs (push)

如何添加另一个提取 URL?

我相信您需要一个不同的遥控器,如前所述。我也认为它不是一个好的工作模式。

考虑到这一点,如前所述here,您可以尝试

git remote add <shortname> <url>