override git config --system in .gitconfig user file ( git config --global )

删除回忆录丶 提交于 2019-11-27 05:13:22

If it is a system wide config, each user can override a config value in his/her global and local settings.

But there is no easy way to "deactivate" a setting in a lower config file.
Even set it to "" generally has unintended consequences. That very topic was discussed in April 2010.

For instance, deactivating the send-email option:

True, after thinking a bit about this using no value to unset is a horrible, horrible hack.
git-send-email should be corrected to not only check that there is value from config or command line option, but also that it is sane (i.e. non-empty, or simply true-ish if we say that smtpuser = "0" is not something we need to worry about supporting).

That would be true for any setting: the diff.c#run_diff_cmd() function will attempt to run an external diff if it has detected and diff.external value (even "").

if (!strcmp(var, "diff.external"))
  return git_config_string(&external_diff_cmd_cfg, var, value);

leads to:

if (pgm) {
  run_external_diff(pgm, name, other, one, two, xfrm_msg,
  complete_rewrite);
  return;
}

So there is no easy way to block a system wide diff external, except by making sure those users reference a different git system installation path (meaning a different system setting).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!