我无法克隆一个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并将其添加到您的Bitbucket帐户或其他地方后仍然存在访问问题,您需要在git, OSX或Linux上的终端上执行以下操作:

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

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

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

这对我很管用。

其他回答

解决方案: 在您试图克隆到或从其推送的服务器上 猫~ / . ssh / id_rsa . pub 进入GitHub,设置,SSH和GPG密钥,新的SSH密钥 粘贴键。

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

保存并退出。

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

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

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

我看到这个错误信息有很多不同的原因。 当我试图在本地设置另一个存储库时,除了一个已经完全使用ssh等,并将其连接到同一服务器,但其他存储库时,我也犯了同样的错误。这里找不到答案,但我想出来了。所以我发布了它。希望能帮到别人。

git remote add origin git@git.ourserver.com:teamalpha/repositorytwo.git

如果这些答案都没用

你使用的是Windows 您可以使用Putty生成密钥,或者已经安装了Putty 你的电脑 你可以用CMD或PowerShell生成密钥

Try

删除你的钥匙 在windows上搜索Git Bash,然后生成一个 Git Bash命令行中的新密钥 添加公钥到您的在线回购

然后,你会发现git克隆后,输入yes确认,它应该开始克隆