gitignore';s搜索模式

gitignore';s搜索模式,git,gitignore,Git,Gitignore,.gitignore行有其特定的解释规则 其他工具也使用相同的规则,例如npm的包中的文件键。json需要相同的格式 这个图案有名字吗?或者最合适的名称是什么?这些规则的另一个正式文档在文档中 我认为.gitignore最相似的地方是他们在一些文档中提到的: 如果该模式不包含斜杠/,git将其视为shell glob模式,并检查是否与不带前导目录的路径名匹配 然而,这并不完全相同,这就是它们指定规则的原因 这些规则的另一个正式文档在文档中 我认为.gitignore最相似的地方是他们在一些文档

.gitignore
行有其特定的解释规则

其他工具也使用相同的规则,例如npm的
包中的
文件
键。json
需要相同的格式


这个图案有名字吗?或者最合适的名称是什么?

这些规则的另一个正式文档在文档中

我认为
.gitignore
最相似的地方是他们在一些文档中提到的:

如果该模式不包含斜杠/,git将其视为shell glob模式,并检查是否与不带前导目录的路径名匹配


然而,这并不完全相同,这就是它们指定规则的原因

这些规则的另一个正式文档在文档中

我认为
.gitignore
最相似的地方是他们在一些文档中提到的:

如果该模式不包含斜杠/,git将其视为shell glob模式,并检查是否与不带前导目录的路径名匹配

然而,这并不完全相同,这就是它们指定规则的原因

• A blank line matches no files, so it can serve as a separator for readability. 
• A line starting with # serves as a comment. 
• An optional prefix ! which negates the pattern; any matching file excluded by a previous pattern will become included again. If a negated pattern matches, this will override lower precedence patterns sources. 
• 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). 
• If the pattern does not contain a slash /, git treats it as a shell glob pattern and checks for a match against the pathname without leading directories. 
• Otherwise, git treats the pattern as a shell glob suitable for consumption by fnmatch(3) with the FNM_PATHNAME flag: wildcards in the pattern will not match a / in the pathname. For example, "Documentation/*.html" matches "Documentation/git.html" but not "Documentation/ppc/ppc.html". A leading slash matches the beginning of the pathname; for example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".