git - 为什么要将 .iml 文件添加到 gitignore?在常见情况下应该放在 gitignore 中什么?

标签 git intellij-idea

主要问题是,为什么我应该将 IDEAs *.iml 文件添加到 gitignore?如果那时我得到没有 .iml 文件的 repo,我将被迫创建新项目并手动添加我的文件。我错了吗?

其实我的问题有点宽泛。我在哪里可以找到更多关于我应该为不同的语言和 IDE 做什么的信息。在为首次使用的语言创建新存储库时,也许有一些通用规则?

最佳答案

why should I add IDEAs *.iml files to gitignore?

这些文件在与代码无关的情况下一直被更改。如果您不小心,每次与其他开发人员签到时都会 merge 此文件。

If then I get repo without .iml file, I will forced to create new project and manualy add my files. Am I wrong about it?

如果您使用像 maven、gradle 或 ant 这样的构建工具,则不会。这些是更好的选择,可以在 IntelliJ 之外工作。

Where can I found more information about what should I do for different languages and IDE's.

使用 Google,或者如果您有具体问题,请使用 Stack Overflow。

Maybe there are some general rules when creating new repository for first time used language?

有很多标准,您可以选择。我建议您看看与您的项目类似的项目是如何设置的。

关于git - 为什么要将 .iml 文件添加到 gitignore?在常见情况下应该放在 gitignore 中什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30674208/

相关文章:

git - 拒绝git中的大文件

intellij-idea - IntelliJ 在 .gitignore 文件中提到的项目窗口中隐藏文件夹,如何在项目窗口中显示该文件夹?

java - IntelliJ12 IDE 的 OutOfMemoryError

android - 使用 Android Studio 3.1 开发 AOSP 无法为插桩测试构建测试 apk

java - 在 Intellij 中移动项目,现在无法编译

java - 无法部署Intellij项目

java - 致命: Authentication failed for jenkins

git - 如何推送到 github 上的 pull 请求?

java - 根据构建阶段强制执行不同的设置

windows - Android Studio 到 Git 可执行文件的路径