【问题标题】:How to push a modification on a git submodule without giving username/password如何在不提供用户名/密码的情况下对 git 子模块进行修改
【发布时间】:2014-09-23 15:12:00
【问题描述】:

我目前正在尝试处理 git 子模块,当我想在子存储库上推送修改时遇到了麻烦。

我收到以下错误:

fatal: remote error: 
  You can't push to git://github.com/yllieth/ui.git
  Use https://github.com/yllieth/ui.git

确实,如果我将远程配置更改为使用 HTTPS 而不是 ssh 公钥,它就可以正常工作。但我想避免给出我的 github 的用户名/密码。

是否有人知道一些配置提示或其他可以使用我的公钥推送到子模块的内容?

【问题讨论】:

标签: git git-submodules public-key


【解决方案1】:

如果我将远程配置更改为使用 HTTPS 而不是 ssh 公钥,它会正常工作。

请注意,git://github.com/yllieth/ui.git 不是 ssh url。
见“Which remote URL should I use?”和“Changing a remote's URL”:

git@github.com:username/reponame.git 会。
在你的情况下:git@github.com:yllieth/ui.git

所以你仍然可以使用ssh,但你需要change the submodule url

【讨论】:

  • 我的错!看来我添加了一个错误的 url 的子模块(git:// 而不是 git@...。这将教我使用我的记忆而不是复制和粘贴;)谢谢@VonC​​pan>
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-04-20
  • 2020-08-14
  • 1970-01-01
  • 2020-07-16
  • 2013-08-28
相关资源
最近更新 更多