我有以下目录结构:.gitignore:我如何忽略嵌套的目录?
test/a
test/b/c
test/a/b/Ouput
test/c/d/e/Output
test/f/Output
我想忽略“测试”下的所有“输出”的目录。我试过test/**/Output
,但没有奏效。我究竟做错了什么?
我有以下目录结构:.gitignore:我如何忽略嵌套的目录?
test/a
test/b/c
test/a/b/Ouput
test/c/d/e/Output
test/f/Output
我想忽略“测试”下的所有“输出”的目录。我试过test/**/Output
,但没有奏效。我究竟做错了什么?
你说你想要的Output/
模式只匹配test/
目录下,所以在test/
目录下创建一个.gitignore
文件与内容:
Output/
如果你把你的顶级这种模式.gitignore
文件,则它将匹配全部目录下的顶层目录。
如果我想在我的顶层'.gitignore'中做什么? – artagnon
@RamkumarRamachandra:你为什么不在你的'test/.gitignore'中想要它?你说过你只想'Output'模式在'test'目录下匹配,所以这是模式自然属于的地方。 –
考虑'Output /'而不是'Output'。该问题要求忽略名为'Output'的目录。 –
由于版本1.8.2(月,8日2013),git的支持**在.gitignore
文件,因此使用test/**/Output/
会忽略test目录,只输出子目录。
啊,我明白了。感谢澄清。 – artagnon
@hammar,自v1.8.2(2013年3月8日),git接受** in .gitignore文件 –