本文介绍了.gitignore:如何忽略嵌套目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我具有以下目录结构:
test/a
test/b/c
test/a/b/Ouput
test/c/d/e/Output
test/f/Output
我想忽略测试"下的所有输出"目录.我尝试了test/**/Output
,但是没有用.我在做什么错了?
I want to ignore all the "Output" directories under "test". I tried test/**/Output
, but it didn't work. What am I doing wrong?
推荐答案
您说过要仅test/
目录下的Output/
模式匹配,因此在test/
目录中创建一个.gitignore
文件内容:
You said you want the Output/
pattern to match only under the test/
directory, so in the test/
directory, create a .gitignore
file with the contents:
Output/
如果将此模式放在顶级.gitignore
文件中,则它将在顶级目录下的 all 目录中匹配.
If you put this pattern in your top-level .gitignore
file, then it will match in all directories under the top directory.
这篇关于.gitignore:如何忽略嵌套目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!