我是一位新的 Mac 用户,最近在其上安装了 Mercurial。我想启用一些扩展并正在寻找全局 hgrc 文件。
我找不到它,所以我尝试在/etc/mercurial 和 ~/.hg 中创建“hgrc”文件。
它仍然不起作用,所以我想知道这里是否有人解决了这个问题。
非常感谢。
最佳答案
你的.hgrc
需要位于~/.hgrc
,就像在其他类unix操作系统上一样(假设你使用的是标准的Mercurial安装而不是其他东西)像麦克 Mercurial )。您可以使用 /etc/mercurial
,但在这种情况下,文件名为 hgrc
,而不是 .hgrc
。
您也可以直接询问 hg
这个问题,它应该会为您的安装提供最新的答案:
$ hg help config
Configuration Files
Mercurial reads configuration data from several files, if they exist. Below we list the most specific file first.
On Unix, these files are read:
- "<repo>/.hg/hgrc"
- "$HOME/.hgrc"
- "/etc/mercurial/hgrc"
- "/etc/mercurial/hgrc.d/*.rc"
- "<install-root>/etc/mercurial/hgrc"
- "<install-root>/etc/mercurial/hgrc.d/*.rc"
关于macos - Mercurial OS X 扩展启用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3170572/