通过 SSH 克隆 Mercurial 存储库

发布于 2024-10-07 02:34:12 字数 565 浏览 4 评论 0原文

我在通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

你又不是我 2024-10-14 02:34:12

您需要在主机名后添加一个双//,即:

hg clone ssh://[email protected]//path/to/projectname projectname

You need a double // after hostname i.e.:

hg clone ssh://[email protected]//path/to/projectname projectname
无需解释 2024-10-14 02:34:12

听起来 hg 不在您的路径上。 Mercurial 常见问题解答提到了此问题的可能修复方法:FAQ/CommonProblems

通过在客户端计算机上打开 ~/.hgrc(或 Windows 上的 Mercurial.ini)并添加以下:

[ui]
remotecmd = /path/to/hg

其中 /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 (or Mercurial.ini on Windows) on your client machine and adding the following:

[ui]
remotecmd = /path/to/hg

where /path/to/hg is the path to the hg 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.

五里雾 2024-10-14 02:34:12

看起来 Mercurial 不在远程服务器上用户的 PATH 中。

Looks like mercurial isn't in your user's PATH on the remote server.

无力看清 2024-10-14 02:34:12

在 webfactional 上,我必须添加:

export PATH=$PATH:/home/<user>/bin

到 .bashrc 才能使其正常工作。
(也遵循上面的remotecmd建议)

On webfactional I had to add:

export PATH=$PATH:/home/<user>/bin

to .bashrc to get it to work.
(also followed the remotecmd advice above)

滥情哥ㄟ 2024-10-14 02:34:12

在服务器上,键入: nano ~/.bashrc end 通过添加以下内容编辑文件:

# User specific aliases and functions
export PATH=$PATH:$HOME/packages/mercurial

假设 ~/packages 是安装 Mercurial 的文件夹。
编辑后,使用 source ~/.bashrc 结束并重试。

以下详细的在 Bluehost 托管上安装 Mercurial 的指南对我很有帮助服务器。

On the server, type: nano ~/.bashrc end edit the file by adding:

# User specific aliases and functions
export PATH=$PATH:$HOME/packages/mercurial

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.

海的爱人是光 2024-10-14 02:34:12

您可以从终端使用 Sourcetree、TortoiseHg、Mercurial,或您喜欢的任何客户端来克隆 Mercurial 存储库。这些说明向您展示如何从终端使用 Mercurial 克隆存储库。

  1. 从存储库中,单击全局侧栏中的 + 并选择克隆
    该存储库位于“开始工作”下。
  2. 复制克隆命令(SSH 格式或 HTTPS)。
    如果您使用 SSH 协议,请确保您的公钥位于 Bitbucket 中并加载到您要克隆的本地系统上。
  3. 从终端窗口,更改到要克隆存储库的本地目录。
  4. 粘贴您从 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.

  1. From the repository, click + in the global sidebar and select Clone
    this repository under Get to work.
  2. Copy the clone command (either the SSH format or the HTTPS).
    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.
  3. From a terminal window, change to the local directory where you want to clone your repository.
  4. Paste the command you copied from Bitbucket, for example:
    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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文