2014-04-13 56 views
4

当我运行hg clone ssh://[email protected]/repo_dir时,我得到了“远程hg没有合适的响应”和“这里没有Mercurial仓库(找不到.hg)!”。这是什么造成的?我有ssh访问涉及的服务器/文件。mercurial over ssh,没有来自远程hg的合适响应

如果我运行scp -r [email protected]:/repo_dir ./我得到了回购的所有内容,包括.hg就好了。相同ssh [email protected] "ls /repo_dir"

-v什么都不做。输出完全一样。 -vvv

回答

5

原来我的语法错了。 Mercurial使用scp/ssh风格来引用文件,当文件路径是绝对路径时,它需要双斜杠,就像我的情况一样。

另一种方法是在你的家中使用符号链接,或者为根目录添加两个斜杠。

代替:

hg clone ssh://[email protected]/repo_dir 

使用:

hg clone ssh://[email protected]//repo_dir 
#      ^
+0

@Peter编辑自己的帖子说它遵循SCP/SSH路径的风格,但我不同意。在scp的'host/path'上会得到'/ path'的根目录。 mercurial会得到'/ home/user/path'。 scp使用':'将'host'从'path'分开。无论如何只是迂腐:)这里是模糊的标准,如果任何人关心http://tools.ietf.org/html/draft-ietf-secsh-scp-sftp-ssh-uri-01#page-2 – gcb