问题
I am using the latest version of Intellij IDEA 2019.3 on Ubuntu 18.04 and whenever I create a new project I have to add a local git config because Intellij cannot find the global config. From the IDEA terminal git can read my global git settings but IDEA VCS can't.
回答1:
IntelliJ does not have builtin git and thus is not looking for configs itself - it just issues commands to the command-line git client, and git itself reads the configs as needed and applies them.
The only reason for git to see a config when started manually, but not see when started by the IDE could be environmental differences - e.g. if you have some environment variable altering gitconfig (e.g. $GIT_CONFIG
or $XDG_CONFIG_HOME
), which was set in the current tty, but is not available in the IDE context.
Using the default global config file ~/.gitconfig
should always work though
来源:https://stackoverflow.com/questions/60998830/global-git-config-intellij