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

并且存储库存在。


当前回答

这也许很愚蠢,但它确实发生在我们身上:

如果你正在使用bitbucket和Sourcetree,你只是复制粘贴克隆URL到新的回购对话框,它将显示相同的错误时拉或推。

确保你在URL之前删除了“git clone”的东西。

其他回答

对于来这里只是想获取存储库但不关心协议(ssh / https)的人,您可能只想使用https而不是ssh(如果支持ssh的话)。

举个例子

git clone https://github.com/%REPOSITORYFOLDER%/%REPOSITORYNAME%.git

而不是

git clone git@github.com:%REPOSITORYFOLDER%/%REPOSITORYNAME%.git

请注意,GitHub已弃用私人存储库的密码认证(https登录),因为它没有跟上最新的安全标准,使用个人访问令牌。

还需要注意的是,自2022年3月1日起,Bitbucket用户也不能再通过git通过https使用他们的Atlassian帐户密码,而是需要使用Bitbucket应用程序密码。

这也许很愚蠢,但它确实发生在我们身上:

如果你正在使用bitbucket和Sourcetree,你只是复制粘贴克隆URL到新的回购对话框,它将显示相同的错误时拉或推。

确保你在URL之前删除了“git clone”的东西。

修复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将解释上述“长期修复”命令的来源。

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

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

您可以尝试将ssh密钥添加到您的私有密钥链中。这对我很有效

ssh-add -K ~/.ssh/[your-private-key]