Changing .gitconfig location on Windows

后端 未结 13 2484
伪装坚强ぢ
伪装坚强ぢ 2020-11-27 11:49

By default on Windows Git places global .gitconfig in c:\\documents and settings\\user\\

How can I change that position so .gitconfig is stored in

13条回答
  •  庸人自扰
    2020-11-27 12:12

    As someone who has been interested in this for a VERY LONG TIME. See from the manual:

    $XDG_CONFIG_HOME/git/config - Second user-specific configuration file. If $XDG_CONFIG_HOME is not set or empty, $HOME/.config/git/config will be used. Any single-valued variable set in this file will be overwritten by whatever is in ~/.gitconfig. It is a good idea not to create this file if you sometimes use older versions of Git, as support for this file was added fairly recently.

    Which was only recently added. This dump is from 2.15.0.

    Works for me.

提交回复
热议问题