作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
为什么人们会遇到这个问题?
$ git clone --recursive git@github.com:acani/Chats.git克隆到“聊天”...权限被拒绝(公钥)。致命:无法从远程存储库读取。
请确保您拥有正确的访问权限并且存储库存在。
https://github.com/acani/Chats/issues/53#issuecomment-118014684
我读过一些答案,说要将子模块 URL 从 SSH 更改为 HTTP,但我为什么必须这样做。我不想那样做。我想保留它 SSH,这样我就不必在终端中输入我的用户名和密码,如果我想推送。每个人都可以很好地克隆 SSH URL,那么为什么他们不能递归地将其克隆为子模块呢?
最佳答案
作为解决方法,您可以尝试对任何 github 存储库使用 https url:
cd myParentRepo
git config url.https://github.com/.insteadOf ssh://git@github.com/
# or
git config url.https://github.com/.insteadOf git@github.com:
关于git - 如何为 Git 子模块使用 SSH 而不是 HTTP?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31184930/
我是一名优秀的程序员,十分优秀!