通过 SSH 克隆 Mercurial 存储库
我在通过 ssh 克隆我的 Mercurial 存储库时遇到一些困难。
这是我尝试过的:
hg clone ssh://[email protected]/path/to/projectname projectname
它给了我这个错误:
remote: bash: hg: command not found
abort: no suitable response from remote hg!
然而,hg 已安装在服务器上。
我尝试按照此网站上的说明进行操作。
I'm having some difficulty cloning my mercurial repository over ssh.
Here's what I have tried:
hg clone ssh://[email protected]/path/to/projectname projectname
It's giving me this error:
remote: bash: hg: command not found
abort: no suitable response from remote hg!
hg is installed on the server, however.
I was trying to follow the instructions on this website.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您需要在主机名后添加一个双//,即:
You need a double // after hostname i.e.:
听起来
hg
不在您的路径上。 Mercurial 常见问题解答提到了此问题的可能修复方法:FAQ/CommonProblems。通过在客户端计算机上打开
~/.hgrc
(或 Windows 上的Mercurial.ini
)并添加以下:其中
/path/to/hg
是远程服务器上hg
命令的路径。如果您的 Mercurial 配置出现问题,您可以使用
hg showconfig --debug
命令获取 Mercurial 设置的完整列表以及定义的配置文件的路径和行号每个配置值。Sounds like
hg
is not on your path. The Mercurial FAQ mentions possible fixes for this issue: FAQ/CommonProblems.Add the
remotecmd
value to your Mercurial configuration by opening~/.hgrc
(orMercurial.ini
on Windows) on your client machine and adding the following:where
/path/to/hg
is the path to thehg
command on the remote server.If you're having problems with your Mercurial configuration, you can use the
hg showconfig --debug
command to obtain a full list of your Mercurial settings along with the path and line number of the configuration file that defines each configuration value.看起来 Mercurial 不在远程服务器上用户的
PATH
中。Looks like mercurial isn't in your user's
PATH
on the remote server.在 webfactional 上,我必须添加:
到 .bashrc 才能使其正常工作。
(也遵循上面的remotecmd建议)
On webfactional I had to add:
to .bashrc to get it to work.
(also followed the remotecmd advice above)
在服务器上,键入:
nano ~/.bashrc
end 通过添加以下内容编辑文件:假设
~/packages
是安装 Mercurial 的文件夹。编辑后,使用
source ~/.bashrc
结束并重试。以下详细的在 Bluehost 托管上安装 Mercurial 的指南对我很有帮助服务器。
On the server, type:
nano ~/.bashrc
end edit the file by adding:Under the assumption that
~/packages
is the folder where mercurial was installed.After editing, finish off with
source ~/.bashrc
and try again.Pretty helpful to me was the following elaborate guide to install mercurial on a Bluehost hosting server.
您可以从终端使用 Sourcetree、TortoiseHg、Mercurial,或您喜欢的任何客户端来克隆 Mercurial 存储库。这些说明向您展示如何从终端使用 Mercurial 克隆存储库。
该存储库位于“开始工作”下。
如果您使用 SSH 协议,请确保您的公钥位于 Bitbucket 中并加载到您要克隆的本地系统上。
通过 HTTPS 克隆:
$ hg clone https://[电子邮件受保护]/teamsinspace /hg-文档-测试
通过 SSH 克隆:
$ hg clone ssh://[电子邮件受保护]/teamsinspace /hg-文档-测试
如果克隆成功,本地驱动器上会出现一个新的子目录。
此目录与您克隆的 Bitbucket 存储库同名。
克隆包含 Mercurial 维护您对源文件所做的更改所需的文件和元数据。
You can use Sourcetree, TortoiseHg, Mercurial from the terminal, or any client you like to clone your Mercurial repository. These instructions show you how to clone your repository using Mercurial from the terminal.
this repository under Get to work.
If you are using the SSH protocol, ensure your public key is in Bitbucket and loaded on the local system to which you are cloning.
CLONE OVER HTTPS:
$ hg clone https://[email protected]/teamsinspace/hg-documentation-tests
CLONE OVER SSH:
$ hg clone ssh://[email protected]/teamsinspace/hg-documentation-tests
If the clone was successful, a new sub-directory appears on your local drive.
This directory has the same name as the Bitbucket repository that you cloned.
The clone contains the files and metadata that Mercurial requires to maintain the changes you make to the source files.