我无法克隆一个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密钥并重新启动并尝试了所有其他“n”解决方案。但对我来说,真正的问题是我们的gitlab默认协议从ssh变成了https。

检查远程url

git remote -v

更改远程url

git remote set-url origin https://URL

其他回答

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

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

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

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

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

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

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

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

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

检查远程url

git remote -v

更改远程url

git remote set-url origin https://URL

Github(或Bitbucket)在他们的服务器上找不到你的ssh密钥。

只需在您的帐户设置中添加您的密钥。