Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
hg git的权限被拒绝_Git_Github_Ssh_Mercurial - Fatal编程技术网

hg git的权限被拒绝

hg git的权限被拒绝,git,github,ssh,mercurial,Git,Github,Ssh,Mercurial,我正试图从git repo中提取数据,并使用读写访问将其转换为mercurial,但我一直遇到以下错误: hg clone git+ssh://github.com/user/myrepo.git destination directory: myrepo Permission denied (publickey). abort: git remote error: The remote server unexpectedly closed the connection. 根据的建议,我通过“

我正试图从git repo中提取数据,并使用读写访问将其转换为mercurial,但我一直遇到以下错误:

hg clone git+ssh://github.com/user/myrepo.git
destination directory: myrepo
Permission denied (publickey).
abort: git remote error: The remote server unexpectedly closed the connection.

根据的建议,我通过“git add github_rsa”将与我的git帐户相关联的私钥添加到,但没有任何效果。我在私人回购和将其改为公开回购两方面都尝试过。我还将所有必要的添加内容放入了.hgrc文件中。有人知道怎么解决这个问题吗

您需要使用
git@github.com
而不是
github.com
,例如:
hg clone git+ssh://git@github.com/user/myrepo
git add
与Mercurial | HGGit无关。您已经(除了使用正确的URL,如Reimer所述):1)在您的Github帐户中注册您的公钥2)根据服务器需求为已发布的私钥提供私钥证据(取决于操作系统,我无法预测您的情况)