为什么 Mercurial 会忽略我的一些文件?

Why is Mercurial ignoring some of my files?

让 运行 'hg init' 和 'hg add' 创建一个新的 Mercurial 存储库并添加文件,我发现相当多的文件没有被跟踪(它们显示'hg status -i'),但似乎与我的 .hgignore 文件中的任何模式都不匹配,所以我看不出问题所在。这是 .hgignore 文件:

# Eclipse project files
.classpath
.project
.settings/

# IntelliJ project files
\.iml
\.ipr
\.iws
.idea/
out

# Grails files and dirs that should not be versioned
target
web-app/WEB-INF/classes
web-app/WEB-INF/tld/c.tld
web-app/WEB-INF/tld/fmt.tld
stacktrace.log
plugin.xml
devDb.*
prodDb.*

# Mac OS/X finder files
.DS_Store

oldhg/

例如“/grails-app/views/layouts”中的所有文件都被忽略,但我在 .hgignore 文件中看不到任何会导致此问题的内容。我错过了什么?我怎样才能强制这些文件不被忽略?

字符串 out 匹配任何包含它的内容,包括 layouts/。如果你想让它只匹配名字的开头或结尾,你需要用 ^$.

来锚定它