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

并且存储库存在。


当前回答

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

其他回答

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

注:

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

在为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

保存并退出。

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

对于Fedora 33+和Bitbucket用户:

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

选项1:

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

Host bitbucket.org
  PubkeyAcceptedKeyTypes +ssh-rsa

选项2:

使用更安全的算法。

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

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

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

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

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

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

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

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