将PyCharm与Git结合使用时,是否应该忽略.idea文件夹?
我了解了PyCharm中的Git集成,并从PyCharm创建了一个Git存储库.我在PyCharm中这样做是因为我希望PyCharm知道是否应该忽略 .idea
文件夹,如果是这种情况,它将自动创建一个 .gitignore
文件,其中的 .idea/
行.
I read about Git integration in PyCharm, and created a Git repository from PyCharm. I did this in PyCharm because I was hoping PyCharm would know whether the .idea
folder should be ignored, and if that's the case, it would automatically create a .gitignore
file with the line .idea/
in it.
但是没有,所以我认为我不应该忽略 .idea
角色.但是,我进行了快速搜索,在某人的示例 .gitignore
文件此处,它显然会忽略 .idea
文件夹.
But it didn't, so I assumed that I shouldn't ignore the .idea
foler. However, I did a quick search and found someone's example .gitignore
file, here, which clearly ignores the .idea
folder.
所以,我的问题是,是否应该忽略 .idea
文件夹?
So, my question is, should the .idea
folder be ignored or not?
忽略整个.idea文件夹不一定是最好的主意.这里有许多类似的讨论.
Ignoring the whole .idea folder is not necessarily the best idea. There's a number of similar discussions here about this.
- 如何处理在Git源代码控制下的IntelliJ IDEA项目文件不断变化吗?
- Intellij Idea 9/10,要检查(或不检查)源代码管理的文件夹是什么?
- 应该将.idea文件夹置于源代码管理之下吗?
但是我建议对此事查看官方常见问题解答.
But I suggest to check the official FAQ on this matter.