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

我也面临着同样的问题。我做了下面的事情,它对我很有效:

从Windows上的GIT GUI客户端生成密钥。将此密钥复制到剪贴板。 在bitBucket/ git网站上打开您的帐户,并将此密钥添加到您的配置文件中。这样,服务器就知道您是从合法系统访问的合法用户。 就是这样。从此以后,所有的推命令都对我有用。

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

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

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

注:

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

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

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

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

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

这对我很管用。