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

并且存储库存在。


当前回答

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

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

其他回答

我遵循了生成新的SSH密钥并将其添加到SSH -agent和

在Git for Windows上自动启动ssh-agent。

在我的情况下~/。我的Windows中没有配置文件。 我必须创建它,然后添加上面链接中提供的脚本。

我在windows命令行运行git clone命令时遇到了同样的问题。但是该命令在Git Bash中成功运行。

对于Fedora 33+和Bitbucket用户:

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

选项1:

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

Host bitbucket.org
  PubkeyAcceptedKeyTypes +ssh-rsa

选项2:

使用更安全的算法。

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

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

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

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

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