git - 无法使用 git clone git ://. 克隆 repo .. - 可以使用 git clone http://

标签 git http git-clone

这里是 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/

相关文章:

git命令将一个文件夹移动到另一个文件夹

apache - 将所有 https 请求重定向到 http

http - 如何在 PowerShell 中使用 HTTP GET?

android - 主机名不能为空,包括 android 中的 http

git - 获取任意 git 工作副本并制作与远程分支完全相同的副本

git - 什么是悬空树?新的 Git 存储库有悬空树 4b825dc642cb6eb9a060e54bf8d69288fbee4904

git create stash 无需配置 user.email 和 user.name (git stash --author ?)

git - sourcetree 行结束问题

c - 如何修复 `_meta' 的多个定义?

windows - 无法在网络驱动器上克隆 GIT 存储库