Community
Participate
Working Groups
Build Identifier: Version: 3.7.0 Build id: I20110613-1736 The project has a directory 'tmp' with files in it. None of the files in 'tmp' is commited. In .gitignore there is a line: /tmp/ However, when trying to commit, EGit displays 'tmp' as unknown resource. Removing the trailing slash resolves the problem, but according to gitignore manpage: If the pattern ends with a slash, it is removed for the purpose of the following description, but it would only find a match with a directory. In other words, foo/ will match a directory foo and paths underneath it, but will not match a regular file or a symbolic link foo (this is consistent with the way how pathspec works in general in git). So, '/tmp/' should ignore 'tmp' dir, as '/tmp' does. Reproducible: Always
Hm, things are a bit more complicated. The .gitignore pattern '/tmp/' is not working *only* when there is another repo in tmp. So, if the directory structure looks like .git/ tmp/ .git someotherfile other no-.git-files-here and .gitignore looks like /tmp/ /other/ EGit will (correctly) ignore 'other' and (incorrectly) not ignore 'tmp'.