EGit和Eclipse修改.gitignore文件,但不应该 [英] EGit and Eclipse modifies .gitignore file but it should not

查看:715
本文介绍了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.


  1. code> git checkout .gitignore ,我得到了好的版本的文件

  2. 然后我去Eclipse窗口

  3. 然后我返回终端并发出: git status

  4. 我可以看到.gitignore现在被修改了。 / li>
  1. git checkout .gitignore, I get the good version of the file
  2. Then I go to Eclipse window
  3. Then I go back to terminal and issue: git status,
  4. I can see that .gitignore is now modified.

怎么可能?

推荐答案

默认情况下,EGit会自动将标记为派生的资源添加到 .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.

你可以通过去到窗口>首选项>团队> Git>项目,并取消选择通过将派生资源添加到.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文件,但不应该的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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