hgrc中的Mercurial路径

bal*_*oth 14 mercurial

我需要知道是否可以在我的hgrc文件中添加如下内容:

[paths]
default = http://somehost.com/repos/
live = ssh://user@host.com//home/user/public_html
Run Code Online (Sandbox Code Playgroud)

我在http://www.selenic.com/mercurial/hgrc.5.html#paths上阅读了一些有关此内容的信息 但我的问题是我不知道如何使用它.我的猜测是它应该是这样的:

hg pull @live
Run Code Online (Sandbox Code Playgroud)

也许我错过了一些文档.

谢谢

Tim*_*gan 27

来自hg help urls:

URL可以全部存储在配置文件中,路径别名位于[paths]部分下,如下所示:

  [paths]
  alias1 = URL1
  alias2 = URL2
  ...
Run Code Online (Sandbox Code Playgroud)

然后,您可以对使用URL的任何命令使用别名(例如, hg pull alias1将其视为 hg pull URL1).

两个路径别名是特殊的,因为当您不为命令提供URL时,它们将用作默认值:

  1. 默认
  2. 默认情况下,推

  • 答案非常详细!它可以很简单,"do'hg pull live',no @ required":) (4认同)