我无法克隆一个Git存储库,并得到这个错误:

krishna.soni@KRISHNACHANDRAS /c/Projects $ git clone http://stage.abc.com:10088/pqr
http://<url>/<repository> Cloning into '<repository>'... fatal: could not read Username for 'http://<url>': No such file or directory

我读过Bitbucket, Windows和“致命:无法读取密码”,但仍然有问题。

我继续前进,但现在得到这个错误

sh.exe": chown: command not found

krishna.soni@KRISHNACHANDRAS /c
$ git clone ssh://krishna.sonipayu.in@stage.payupaisa.
/projects
Cloning into 'C:/projects'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

> krishna.soni@KRISHNACHANDRAS /c
>     $ git clone ssh:<url>
>     ts
>     Cloning into 'C:/projects'...
>     Permission denied (publickey).
>     fatal: Could not read from remote repository.

Please make sure you have the correct access rights

并且存储库存在。


当前回答

这也许很愚蠢,但它确实发生在我们身上:

如果你正在使用bitbucket和Sourcetree,你只是复制粘贴克隆URL到新的回购对话框,它将显示相同的错误时拉或推。

确保你在URL之前删除了“git clone”的东西。

其他回答

对我来说,当我想从我的存储库克隆时,我在“权限被拒绝(publickey)致命:无法从远程存储库读取”之前注意到相同的消息。对于我的情况的解决方案是不使用sudo之前克隆,就是这样。

我在GitHub上也遇到了同样的问题。下面是解决方法!

在您的计算机上生成一个SSH密钥,如下所述:生成SSH密钥。 登录您的GitHub帐户:GitHub Login。 在您的帐号中添加新生成的“SSH Key: My account SSH Key”。 再次尝试git克隆项目。

在为gitlab设置ssh时,我也遇到了同样的问题。我已经有ssh的github和我不能覆盖。 对我有效的步骤是:

生成带有新路径的SSH并添加到SSH列表SSH -add /path/to/new/id_rsa。 在~/中创建一个名为config的文件。ssh /使用。我使用vi ~/.ssh/config/。 将其添加到新创建的文件中

GitLab com服务器 主机gitlab。com RSAAuthentication赛 IdentityFile path / to / new / id_rsa

保存并退出。

在那之后,重新启动终端并尝试按,它应该工作

您需要执行ssh-keygen -t rsa命令创建新的ssh密钥。

我也犯了同样的错误。我的解决方案是注销并再次登录,因为我的ssh-agent已经与远程ssh密钥不同步。

在这里加上这个,以防有人看到其他答案似乎不适用于他们的情况。