使用TortoiseHg克隆读写github存储库 [英] Cloning a read-write github repository using TortoiseHg

查看:423
本文介绍了使用TortoiseHg克隆读写github存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用git + ssh协议与TortoiseHg在github上克隆我的个人分支。这给了我一个相当奇怪的错误。这里是命令

I'm trying to clone my personal fork on github using the git+ssh protocol with TortoiseHg. It's giving me a rather strange error. Here is the command

hg clone git+ssh://git@github.com:myusername/thefork.git

这是在我安装了hg-git模块之后,它可以很好地使用git://克隆句法。但我相信它在使用ssh时遇到了麻烦。我得到的错误是这样的。

This is after I have installed the hg-git module and it works just fine to clone using the git:// syntax. But I believe it's having trouble with the ssh. The error I'm getting is this.

importing Hg objects into Git
[Error 2] The system cannot find the file specified

我已经尝试将ssh命令手动添加到像这样的mercurial.ini文件中



I have tried adding manually the ssh command into the mercurial.ini file like this

[ui]
username = email@address.com
ssh="C:\Program Files\TortoiseHg\TortoisePlink.exe" -ssh -2 -i "C:\Source\SSHPrivateKey.ppk"

但我仍然得到同样的错误。任何想法?

But I still get the same error. Any ideas?

更新1

Git Bash shell它工作得很好。

If I run the same command from the Git Bash shell it works just fine. I get this.

importing Hg objects into Git
Counting objects: 1559, done.
Compressing objects: 100% (586/586), done.
Total 1559 (delta 960), reused 1534 (delta 947)
importing Git objects into Hg
at:  0/86
updating to branch default
219 files updated, 0 files merged, 0 files removed, 0 files unresolved

我假设这是因为它可以找到ssh.exe和我的密钥已经导入。我可以将ssh.exe的路径添加到Windows命令提示符路径,然后代替以前的错误,我得到了这个。

I'm assuming it's because it can find ssh.exe and my key is already imported. I can add the path of ssh.exe to the windows command prompts path and then instead of the previous error I get this.

importing Hg objects into Git
Permission denied (publickey).
abort: the remote end hung up unexpectedly

看起来它特别针对ssh。 exe尽管我已经在mercurial.ini中指定了备用ssh路径。但我的猜测是,该配置仅适用于启用了ssh的mercurial服务器,并且不适用于hg-git插件。

It seems that it's looking specifically for ssh.exe eventhough I have specified the alternate ssh path in mercurial.ini. But my guess here is that that configuration is only for a ssh enabled mercurial server and doesn't apply to the hg-git plugin.

推荐答案

我找到了解决办法,但它非常恶心。我注意到ProcessMonitor显示它在几个不同的路径中查找ssh.exe,所以我复制了TortoiseHg文件夹中的TortoisePlink.exe并将其命名为ssh.exe。

I have found a way around this but it's pretty hackish. I noticed that ProcessMonitor was showing it looking for ssh.exe in several different paths so I copied the TortoisePlink.exe in the TortoiseHg folder and named it ssh.exe.

copy "C:\Program Files\TortoiseHg\TortoisePlink.exe" "C:\Program Files\TortoiseHg\ssh.exe"

只需进行此更改,它仍然会失败身份验证。

With just this change it will still fail the authentication. You'll get a pop-up box and this.

importing Hg objects into Git
abort: the remote end hung up unexpectedly

所以你需要持有 pageant.exe与主PuTTy安装附带。开始并将您的密钥添加到它。然后再次运行clone命令,它应该进行身份验证。

So you need to get a hold of pageant.exe that comes with the main PuTTy install. Start that up and add your key to it. Then run the clone command again and it should authenticate just fine.

这篇关于使用TortoiseHg克隆读写github存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆