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

并且存储库存在。


当前回答

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

其他回答

如果在创建SSH并将其添加到您的Bitbucket帐户或其他地方后仍然存在访问问题,您需要在git, OSX或Linux上的终端上执行以下操作:

# Lists already added identities (‘ssh keys’)
ssh-add -l

然后,如果你没有看到你的密钥列出,添加它与以下(替换身份为其真实名称):

# Add a new identity
ssh-add ~/.ssh/identity

这对我很管用。

我在linux上也遇到了类似的问题。我通过登录到github服务器并创建一个部署密钥来解决这个问题。这是存储库的设置。然后,复制并粘贴我的公钥(通常在~/.ssh/id_rsa中)。Pub,但您的配置可能不同)。有一个复选框给予该密钥写权限。单击它(除非您只使用git进行部署,在这种情况下,不要单击它)。

我也犯了同样的错误。我的解决方案是注销并再次登录,因为我的ssh-agent已经与远程ssh密钥不同步。

在这里加上这个,以防有人看到其他答案似乎不适用于他们的情况。

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

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

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

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

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