Git .hgrcpath 的替代品

发布于 2024-09-30 01:55:34 字数 133 浏览 0 评论 0原文

Git 是否有类似 Hg 的 HGRCPATH 的东西,即一个环境变量,您可以修改它来更改 Hg 搜索其全局配置文件的位置。

在 git 中,这可以通过更改 HOME 来完成,但这会影响未知数量的其他应用程序,这就是我试图避免它的原因。

Does Git have anything like Hg's HGRCPATH, i.e. an enviromental variable which you can modify to change the location where Hg will search for its global configuration file.

In git that can be somewhat accomplished by changing HOME, but that will affect unknown number of other applications, which is why I'm trying to avoid it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

反话 2024-10-07 01:55:35

有一个名为 GIT_CONFIG 的环境变量:

从给定的配置中获取配置
文件而不是 .git/config。使用
“--global”选项强制此
〜/ .gitconfig。使用“--系统”
选项强制此
$(前缀)/etc/gitconfig。

另请检查 git 文档 了解有关 git 配置的更多信息。

There's environmental variable called GIT_CONFIG:

Take the configuration from the given
file instead of .git/config. Using the
"--global" option forces this to
~/.gitconfig. Using the "--system"
option forces this to
$(prefix)/etc/gitconfig.

Also check git docs for more information about git configs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文