这里是 Git 新手。我在新的 Ubuntu VM 上设置 git 并尝试克隆一些 repos。克隆适用于以下命令:
git clone http://github.com/organisation_name/repo_name
(提示输入用户名/密码后),但失败
git clone git://github.com/organisation_name/repo_name
还有
git clone git://github.com/organisation_name/repo_name.git
同样的错误信息:
Cloning into 'repo_name'...
fatal: remote error:
Repository not found
当然,显而易见的答案是“使用http
方法”,但我试图理解为什么一个有效而另一个无效。有什么建议么? (在 repo 名称 btw 上使用 .git
扩展名时也有什么区别吗?)
谢谢!
最佳答案
好吧,我认为你在第二种情况下使用了错误的 url
试试这个
git clone git@github.com:organisation_name/repo_name.git
区别在于使用 git@
时 url 中的 :
与您当前使用的 /
以及额外的 .git
最后。
如果您转到 github 并选择用于克隆的 ssh url(而不是默认选择的 https),这应该是相同的 url
关于git - 无法使用 git clone git ://. 克隆 repo .. - 可以使用 git clone http://,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19683557/