Gide应该跟踪.idea文件夹中的哪些文件? [英] Which files in .idea folder should be tracked by Git?

查看:143
本文介绍了Gide应该跟踪.idea文件夹中的哪些文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与Netbeans不同,在Jetbrains IDE中,与用户和团队相关的设置文件混合在同一文件夹中,这在需要将其推入git时非常棘手.

Unlike Netbeans, in Jetbrains IDEs, the setting files related to user and team are mixed in the same folder that make it a tricky when you need to push them to git.

对于这些IDE和 https://intellij,有许多示例git忽略文件git网站上的-support.jetbrains.com/hc/articles/206544839 页面.

There is a number of sample git ignore files for these IDEs and https://intellij-support.jetbrains.com/hc/articles/206544839 page on git site.

但是,使用它们几个月后,我们发现进行反向操作更安全,实际上更方便.我的意思是忽略所有.idea文件,仅显式添加仅与团队相关的设置. (而不是全部添加并忽略某些内容).

However after using them for a months we figure out that it is safer and actually more convenient to do the reverse. I mean ignoring all .idea files and adding only team related settings explicitly. (instead of adding all and ignoring some).

开发人员之间可以共享的主要内容是代码样式配置.因此,使用IDE自动重新格式化选项,所有团队都将遵循一致的样式.

The main thing that can be shared among developers is code style configs. So using IDE auto-reformatting option all team will follow a consistent style.

此外,问题是建议将哪些其他文件包括进来而不被忽略?为什么?

Beside that, the question is that which other files are recommenced to be included not ignored? Why?

answer:我想出了这个: https://github.com/salarmehr/idea-gitignore

answer: I came up with this: https://github.com/salarmehr/idea-gitignore

推荐答案

经过一番调查,我想到了以下.idea/.gitignore文件:

After some investigation I came up with the following .idea/.gitignore file:

# ignore all .idea files ...
*
# except  ...

# Version Control configuration
!vcs.xml

# how IDEA should treat the text files
!encodings.xml

# automatic code formatting
!codeStyleSettings.xml

# project specific words
!dictionaries

!copyrights
!misc.xml
!sqldialects.xml

上述文件实际上对于所有团队成员而言都是相同的.

Above files should practically be identical for all team members.

answer:我想出了这个: https://github.com/salarmehr/idea-gitignore

answer: I came up with this: https://github.com/salarmehr/idea-gitignore

这篇关于Gide应该跟踪.idea文件夹中的哪些文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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