问题描述
请参考在线文档:
对我来说,该文档说,给定模式"foo",仅相对于.gitignore文件,将忽略任何名为"foo"的文件或目录.我没有阅读任何解释其递归行为的内容. Shell全局变量(来自我读过的内容)不是递归的
To me, this documentation says that given a pattern 'foo', any file or directory named 'foo' will be ignored only relative to the .gitignore file. I don't read anything explaining its recursive behavior. Shell globs (from what I read and experience) are not recursive.
现在在其下方进一步说明了双星号:
Now further below it explains the double asterisk:
所以是的,文档中有一个示例说明**/foo
等于foo
,但是递归行为仍然是隐式的.
so yes there is an example in the docs explaining that **/foo
is equal to foo
, but the recursive behavior remains implicit.
推荐答案
"foo
"之类的规则的递归性质是从获取和应用这些规则的方式中得出的:
The recursive nature of a rule like "foo
" is derived from the way those rules are fetched and applied:
因此,即使.gitignore下有多个子目录,规则"foo
"仍将适用于在该子文件夹中找到的任何"foo
"文件.
So even multiple sub-directories below a .gitignore, the rule "foo
" will still apply to any "foo
" file found in said sub-folder.
这篇关于哪里指定gitignore递归行为?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!