我无法克隆一个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

并且存储库存在。


当前回答

有用的线索,我没有带来太多的新东西。我所采取的步骤也是马克西姆有益地指出的描述的一部分,但有些人可能会忽略它。本节为“将SSH密钥添加到SSH -agent”。

我已经生成了我的ssh-key,但重启后,我无法克隆我自己的存储库之一。

为了克隆,我必须启动ssh-agent并将私钥添加到该代理。

eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa

其他回答

对于Fedora 33+和Bitbucket用户:

出现这个问题是因为哈希算法过时了。正如Bitbucket上提到的,有两种选择:

选项1:

添加到~/。ssh / config文件。(如果文件不存在,就创建它。)

Host bitbucket.org
  PubkeyAcceptedKeyTypes +ssh-rsa

选项2:

使用更安全的算法。

ssh-keygen -t ed25519 -C "your_email@example.com"

如果你生成新的公共ssh密钥并插入到bitbucket或github和

没用,请重新启动你的电脑。它帮助了我!!

这看起来像是权限问题,而不是Windows 7的问题。

您的ssh密钥未被授权-权限被拒绝(publickey)。

您需要创建一个公共ssh密钥,并请求Git存储库的管理员添加ssh公钥

如何执行此操作的信息:保存ssh密钥失败

如果这些答案都没用

你使用的是Windows 您可以使用Putty生成密钥,或者已经安装了Putty 你的电脑 你可以用CMD或PowerShell生成密钥

Try

删除你的钥匙 在windows上搜索Git Bash,然后生成一个 Git Bash命令行中的新密钥 添加公钥到您的在线回购

然后,你会发现git克隆后,输入yes确认,它应该开始克隆

我也有类似的问题。我更改了ssh密钥并重新启动并尝试了所有其他“n”解决方案。但对我来说,真正的问题是我们的gitlab默认协议从ssh变成了https。

检查远程url

git remote -v

更改远程url

git remote set-url origin https://URL