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

后端 未结 1 1499
执念已碎
执念已碎 2020-11-29 10:59

I have that file in a system wide configuration (but it can also be included with git config include.path=\"/path/to/defaultconfig\" I would like to reset some

相关标签:
1条回答
  • 2020-11-29 11:25

    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).

    0 讨论(0)
提交回复
热议问题