Nat*_*mer 14 git ssh mercurial github tortoisehg
我正在尝试使用TortoiseHg的git + ssh协议在github上克隆我的个人分叉.它给了我一个相当奇怪的错误.这是命令
hg clone git+ssh://git@github.com:myusername/thefork.git
Run Code Online (Sandbox Code Playgroud)
这是在我安装了hg-git模块之后,它可以使用git://语法进行克隆.但我相信它与ssh有问题.我得到的错误就是这个.
importing Hg objects into Git
[Error 2] The system cannot find the file specified
Run Code Online (Sandbox Code Playgroud)
我试过像这样手动将ssh命令添加到mercurial.ini文件中
[ui]
username = email@address.com
ssh="C:\Program Files\TortoiseHg\TortoisePlink.exe" -ssh -2 -i "C:\Source\SSHPrivateKey.ppk"
Run Code Online (Sandbox Code Playgroud)
但我仍然得到同样的错误.有任何想法吗?
更新1
如果我从Git Bash shell运行相同的命令,它可以正常工作.我明白了
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
Run Code Online (Sandbox Code Playgroud)
我假设它是因为它可以找到ssh.exe并且我的密钥已经导入.我可以将ssh.exe的路径添加到windows命令提示路径,然后我得到这个而不是上一个错误.
importing Hg objects into Git
Permission denied (publickey).
abort: the remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
它似乎专门针对ssh.exe事件,尽管我在mercurial.ini中指定了备用ssh路径.但我的猜测是,该配置仅适用于支持ssh的mercurial服务器,不适用于hg-git插件.
我已经找到了解决这个问题的方法,但它非常具有hackish.我注意到ProcessMonitor正在显示它在几个不同的路径中寻找ssh.exe所以我复制了TortoiseHg文件夹中的TortoisePlink.exe并将其命名为ssh.exe.
copy "C:\Program Files\TortoiseHg\TortoisePlink.exe" "C:\Program Files\TortoiseHg\ssh.exe"
Run Code Online (Sandbox Code Playgroud)
只需进行此更改,它仍然无法通过身份验证.你会得到一个弹出框和这个.
importing Hg objects into Git
abort: the remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
因此,您需要获取主PuTTy安装附带的pageant.exe.启动它并将密钥添加到它.然后再次运行clone命令,它应该验证就好了.
| 归档时间: |
|
| 查看次数: |
3726 次 |
| 最近记录: |