git将fetch url添加到远程

时间:2016-10-29 12:58:58

标签: git git-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个URL:

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

如何添加另一个提取网址?

1 个答案:

答案 0 :(得分:2)

我相信你需要一个不同的遥控器,如上所述here。否则我认为这不是一个好的工作模式。

因此,正如here所述,你可以尝试

git remote add <shortname> <url>