EGit and Eclipse modifies .gitignore file but it should not(EGit 和 Eclipse 修改 .gitignore 文件,但它不应该)
问题描述
我正在使用 Eclipse 和 EGit,但 Eclipse 修改了我的 .gitignore 文件,而我没有要求这样做.只要我打开 Eclipse,.gitignore 文件就会被修改.
I'm using Eclipse and EGit, but Eclipse modifies my .gitignore file without me asking to do so. As soon as I open Eclipse the .gitignore file is modified.
我已经向 .gitignore 添加了一些文件夹(通过 EGit),但之后删除了它们,但 Eclipse 不断向 .gitignore 添加已删除的行.
I've added some folders to .gitignore (through EGit) but removed them after, but Eclipse keeps adding removed lines to .gitignore.
git checkout .gitignore
,我得到了好版本的文件- 然后我进入 Eclipse 窗口
- 然后我回到终端并发出:
git status
, - 我可以看到 .gitignore 现在被修改了.
git checkout .gitignore
, I get the good version of the file- Then I go to Eclipse window
- Then I go back to terminal and issue:
git status
, - I can see that .gitignore is now modified.
怎么可能?
推荐答案
默认情况下,EGit 会自动将标记为Derived"的资源添加到 .gitignore
.一个典型的例子是包含已编译类的 Java 项目中的 bin
文件夹.
By default, EGit automatically adds resources marked as "Derived" to .gitignore
. A typical example is the bin
folder in a Java project containing the compiled classes.
您可以通过转到 Window > Preferences > Team > Git > Projects 并取消选择通过将派生资源添加到 .gitignore 来自动忽略派生资源"来禁用此功能.
You can disable this by going to Window > Preferences > Team > Git > Projects and deselect "Automatically ignore derived resources by adding them to .gitignore".
EGit 中还有一个错误,它会在 Eclipse 模型和文件系统不同步时添加条目,请参阅 错误 421610(已针对 EGit 3.5 修复).
There was also a bug in EGit where it added entries when the Eclipse model and the filesystem were out-of-sync, see bug 421610 (fixed for EGit 3.5).
这篇关于EGit 和 Eclipse 修改 .gitignore 文件,但它不应该的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:EGit 和 Eclipse 修改 .gitignore 文件,但它不应该


- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01