我使用以下方法在Mabook (M1)上安装了mercurial:
brew install mercurialMercurial (6.1.2)运行良好,但我从Linux安装程序复制的配置文件( ~/.config/hg/下的所有内容,包括hgrc和全局hgignore)都找不到。
man hgrc表示${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc是在Unix下查询的。macOS不被认为是Unix吗?
发布于 2022-06-04 12:51:25
在(Arch) Linux上运行hg config --debug | fgrep 'read config'提供:
read config from: resource:mercurial.defaultrc.mergetools.rc
read config from: /usr/local/etc/mercurial/hgrc
read config from: /etc/mercurial/hgrc
read config from: /home/anthon/.hgrc
read config from: /home/anthon/.config/hg/hgrc而在macOS上,它给出了:
read config from: resource:mercurial.defaultrc.mergetools.rc
read config from: /opt/homebrew/etc/mercurial/hgrc
read config from: /etc/mercurial/hgrc
read config from: /Users/anthon/.hgrc如果您不想用另一个隐藏文件~/.hgrc关闭您的主目录,可以这样做:
sudo mkdir /etc/mercurial # wasn't there on my system
echo '%include ~/.config/hg/hgrc' | sudo tee -a /etc/mercurial/hgrc在此之后,您的~/.config/hg/hgrc应该在mercurial启动时读取。
https://stackoverflow.com/questions/72499837
复制相似问题