简体   繁体   English

从多个git遥控器中选择特定的来源

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM