全局git config Intellij [英] Global git config Intellij

查看:128
本文介绍了全局git config Intellij的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Ubuntu 18.04上使用最新版本的Intellij IDEA 2019.3,每当创建新项目时,都必须添加本地git配置,因为Intellij无法找到全局配置.git可以从IDEA终端读取我的全局git设置,但IDEA VCS无法读取.

解决方案

IntelliJ没有内置的git,因此它本身不是在寻找配置-它只是向命令行git客户端发出命令,而git本身会读取配置根据需要并应用它们.

git手动启动时看到配置的唯一原因是IDE导致启动时看不到配置的唯一原因可能是环境差异-例如如果您有一些环境变量更改gitconfig(例如, $ GIT_CONFIG $ XDG_CONFIG_HOME ),该变量在当前tty中设置,但在IDE上下文中不可用.

尽管使用默认的全局配置文件〜/.gitconfig 仍然可以正常工作

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.

解决方案

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

这篇关于全局git config Intellij的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆