我无法克隆一个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-keygen -t rsa命令创建新的ssh密钥。

其他回答

对于Fedora 33+和Bitbucket用户:

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

选项1:

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

Host bitbucket.org
  PubkeyAcceptedKeyTypes +ssh-rsa

选项2:

使用更安全的算法。

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

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

如果全部失败,就像我的情况一样,卸载GIT,重新安装。出于某种原因,这是固定的。

注:

我尝试生成新的密钥和更新SSH公钥 还尝试删除所有键,并尝试创建一个新键。 没有,我的.gitconfig没有问题

通过浏览器登录bitbucket后, 我推到原点开始工作。

我在Mac上遇到过这个问题——当我正确地设置SSH来访问我的Git存储库时,重启后(有一段时间Mac处于僵局),我的所有凭据都被删除了。显然,由于某种原因,酒吧钥匙被设置为644,导致它从钥匙链中被删除。readd:

Chmod 600公钥 ssh-add ~ /。Ssh /[您的私钥]-这应该显示身份已添加。您想要的密钥文件是没有.pub扩展名的密钥文件。 Ssh-add -l将显示新添加的标识

编辑:显然MacOS有删除密钥的倾向-下载High Sierra更新后(但我还没有安装它),我的密钥被删除了,我必须通过ssh-add重新添加它