我无法克隆一个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等,并将其连接到同一服务器,但其他存储库时,我也犯了同样的错误。这里找不到答案,但我想出来了。所以我发布了它。希望能帮到别人。

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

其他回答

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

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

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

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

这对我很管用。

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

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

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

注:

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

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

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

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

修复hub cli工具:

Git配置—全局中心。协议HTTPS长期 git远程添加OOPS https://github.com/isomorphisms/go.git && git推送OOPS立即修复


此错误发生在hub命令行工具上,因为它们的默认hub错误。协议git-config值。他们设置了回购

git://github.com/schacon/ticgit.git

而不是github实际接受的,即https://github.com/schacon/ticgit.git。


阅读LESS=+/“HTTPS代替”man hub将解释上述“长期修复”命令的来源。