【发布时间】:2021-08-15 04:02:52
【问题描述】:
我正在使用带有内置 git 功能的 Eclipse 做一个 Java 项目。我在与.gitignore 文件相同的目录中有一个Images 文件夹。
我想忽略Images 中的所有文件,除了Destroyed-icon.png Layer_dot.png Not-enough-repair-packs-icon.png。
根据Is there a way to tell git to only include certain files instead of ignoring certain files?,我应该可以在我的.gitignore 文件中使用以下内容,但它不起作用。整个Images 目录被忽略。
Images
!Images/Destroyed-icon.png
!Images/Layer_dot.png
!Images/Not-enough-repair-packs-icon.png
我已经尝试在Images 之前和之后添加/删除所有/,重新启动eclipse,关闭并重新打开项目,但这些都不起作用。
也没有什么要拉的,我的本地存储库是最新的。
【问题讨论】:
-
在上述链接的接受答案中,他们做了一个注释,可能会确切地回答为什么这对你不起作用。
-
@Kraigolas 是的,这正是我所需要的,谢谢