Egit 忽略/Android
我有一个 .gitignore 文件,并且还使用 EGit 来“取消跟踪”和“忽略”我的 Android 项目的 bin 目录中的文件。尽管如此,每当我进行提交时,这三个文件总是在那里(带有灰色的忽略 X 图标),但会自动检查。为什么?
这三个文件是classes.dex、myproject.apk、resources.ap_
我到底怎样才能使它们实际上被忽略并且在提交时不会自动检查?
谢谢。
I've got a .gitignore file and I've also used EGit to "untrack" and "ignore" files in the bin directory of my Android project. Nonetheless, whenever I do a commit, these three files are always there (with their gray ignore X icon) but automatically CHECKED. Why?
The three files are classes.dex, myproject.apk, resources.ap_
How in the world can I make it so these are actually ignored and not auto-checked on a commit?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
robinr 是对的, gitignore 甚至有时会使情况变得更糟。
您可以做两件事:
1)首先删除您试图从 .gitignore 中取消跟踪的文件。之后你就取消跟踪->提交。之后您可以选择 git 忽略它们。
或者
2) 假设不变,这会标记文件,就像您之后从未接触过它们一样,并实现你想要做什么(忽略/取消跟踪)。
robinr is right, git ignore even sometimes worsens the situation.
You can do two things:
1) Remove the files you were trying to untrack from .gitignore first. After that you do untrack->commit. You can choose to git ignore them after this.
OR
2) Assume unchanged, which flags the files as if you never touched them after and achieves what you were trying to do (ignore/untrack).
您可以在 .gitignore 文件中明确声明这些文件。或者,您可以通过将以下内容添加到 .gitignore 来忽略所有 .dex、.apk 和 .ap_ 文件:
You could explicitly state these files in your .gitignore file. Or you could ignore all .dex, .apk, and .ap_ files by adding this to your .gitignore:
如果已经添加了文件,则将它们放入 .gitignore 中没有任何帮助。你也
需要告诉 git 不要再跟踪该文件 (git rm)
If a file has already been added, it does not help to put them into .gitignore. You also
need to tell git not to track the file anymore (git rm)