我在尝试通过ssh克隆我的Mercurial仓库时遇到了一些困难。
以下是我尝试过的:
hg clone ssh://username@username.webfactional.com/path/to/projectname projectname
它给了我这个错误:
remote: bash: hg: command not found
abort: no suitable response from remote hg!
服务器上已安装了hg。
我试图按照这个网站上的指示操作。
我在尝试通过ssh克隆我的Mercurial仓库时遇到了一些困难。
以下是我尝试过的:
hg clone ssh://username@username.webfactional.com/path/to/projectname projectname
它给了我这个错误:
remote: bash: hg: command not found
abort: no suitable response from remote hg!
服务器上已安装了hg。
我试图按照这个网站上的指示操作。
你需要在主机名后面添加双斜杠,即:
hg clone ssh://username@username.webfactional.com//path/to/projectname projectname
看起来 hg
不在您的路径上。 Mercurial FAQ 提到了可能修复此问题的方法:FAQ/CommonProblems。
通过打开客户端机器上的 ~/.hgrc
(或在 Windows 上是 Mercurial.ini
),并添加以下内容,将 remotecmd
值添加到您的 Mercurial 配置中:
[ui]
remotecmd = /path/to/hg
其中 /path/to/hg
是远程服务器上 hg
命令的路径。
如果您在使用 Mercurial 时遇到配置问题,可以使用 hg showconfig --debug
命令获取完整的 Mercurial 设置列表,以及定义每个配置值的配置文件的路径和行号。
.bashrc
中设置您的路径。您是否尝试过在sshd_config
文件中使用PermitUserEnvironment
设置?本文(http://serverfault.com/questions/130834/svnssh-getting-bash-to-load-my-path-over-ssh)讨论了各种可能影响您的`PATH`的设置和环境变量。 - Richard Cookhg --config ui.remotecmd=/path/to/hg clone ...
- lwho看起来在远程服务器上您的用户的PATH
中没有安装Mercurial。
export PATH=$PATH:/home/<user>/bin
将以下代码添加到.bashrc文件中即可生效。 (也要遵循上面的remotecmd建议)
remotecmd
添加到本地.hgrc
中可以解决路径问题。然而,在我的特定设置中,remotecmd
引入了另一个错误:remote: conq: invalid command syntax
。只需将PATH值添加到.bashrc
(在Webfaction上)即可真正解决任何问题。 - Paolo$ hg clone https://username@bitbucket.org/teamsinspace/hg-documentation-tests
$ hg clone ssh://hg@bitbucket.org/teamsinspace/hg-documentation-tests
nano ~/.bashrc
然后通过添加以下内容来编辑文件:
# User specific aliases and functions
export PATH=$PATH:$HOME/packages/mercurial
假设~/packages
是安装mercurial的文件夹。
编辑后,最后用source ~/.bashrc
完成并重试。
对我非常有帮助的是以下详细的在Bluehost托管服务器上安装mercurial的指南。
//
才起作用?这是否有文档记录? - gavenkoa