我想克隆我的個人fork在github上使用git + ssh協議與TortoiseHg。這給了我一個相當奇怪的錯誤。這裏是命令使用TortoiseHg克隆讀寫github存儲庫
hg clone git+ssh://[email protected]: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 protected]
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
它似乎對ssh.exe eventhough我已指定在mercurial.ini備用SSH路徑尋找具體。但我的猜測是,該配置僅適用於啓用了ssh的mercurial服務器,並不適用於hg-git插件。
自我提醒 - 要有耐心。一旦我學會了等待5分鐘左右的時間,就可以克隆一個非常大的回購,hg-git工作得很好。 – 2011-03-07 06:44:02