【发布时间】:2010-04-04 04:31:17
【问题描述】:
我正在尝试使用带有 TortoiseHg 的 git+ssh 协议在 github 上克隆我的个人分支。它给了我一个相当奇怪的错误。这是命令
hg clone git+ssh://git@github.com:myusername/thefork.git
这是在我安装了 hg-git 模块之后,使用 git:// 语法克隆它工作得很好。但我相信它在使用 ssh 时遇到了问题。我得到的错误是这样的。
importing Hg objects into Git
[Error 2] The system cannot find the file specified
我已经尝试像这样手动将 ssh 命令添加到 mercurial.ini 文件中
[ui]
username = email@address.com
ssh="C:\Program Files\TortoiseHg\TortoisePlink.exe" -ssh -2 -i "C:\Source\SSHPrivateKey.ppk"
但我仍然遇到同样的错误。有什么想法吗?
更新 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
我假设这是因为它可以找到 ssh.exe 并且我的密钥已经导入。我可以将 ssh.exe 的路径添加到 windows 命令提示路径中,然后我得到这个错误,而不是之前的错误。
importing Hg objects into Git
Permission denied (publickey).
abort: the remote end hung up unexpectedly
尽管我在 mercurial.ini 中指定了备用 ssh 路径,但它似乎专门寻找 ssh.exe。但我的猜测是,该配置仅适用于启用 ssh 的 mercurial 服务器,不适用于 hg-git 插件。
【问题讨论】:
-
自我注意——要有耐心。一旦我学会等待 5 分钟左右来克隆一个非常大的 repo,hg-git 就可以正常工作了。
标签: git mercurial ssh github tortoisehg