[英]Choose specific origin from multiple git remotes
On my local repository git remote -v
gives the following output. 在我的本地存储库
git remote -v
提供以下输出。
origin https://gitlab.com/***.git (fetch)
origin https://gitlab.com/***.git (push)
origin https://github.com/***.git (push)
Repo has 2 remotes but names are equal. 回购有2个遥控器,但名字相同。 How to push only to one of remote?
如何只推到一个远程? If I specify
git push origin branch
it still pushes to both remotes. 如果我指定
git push origin branch
它仍然会推送到两个遥控器。 Also If I need to rename one of them how to do that? 另外如果我需要重命名其中一个如何做到这一点?
您可以推送到网址, git push https://gitlab.com/example/repo branch
,查看其文档,您可以在配置中取消设置单个密钥,查看其文档, git config --unset remote.origin.url .*theoneidontwant.*
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.