gitignore目录模式忽略具有相同后缀的文件夹,但我想包含它 [英] gitignore directory pattern ignores folder with same suffix, but I want to include it
本文介绍了gitignore目录模式忽略具有相同后缀的文件夹,但我想包含它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下目录结构:
src /
out /
cout /
...
我想忽略 out /
但不是 cout /
。
我试着把 ^ out /
但这似乎并不奏效。我也试过 out /
,但也忽略了 cout /
。
任何建议?
解决方案
感叹号(!)应该在不应忽略的匹配之前。 p>
.gitignore
文件应该如下所示:
out /
!cout /
I have the following directory structure:
src/ out/ cout/ ...
and I want to ignore out/
but not cout/
.
I've tried putting ^out/
, but that doesn't seem to work. I've also tried out/
but that also ignores cout/
.
Any suggestions?
解决方案
Exclamation mark(!) should precede a match which should not be ignored.
The .gitignore
file should look like:
out/
!cout/
这篇关于gitignore目录模式忽略具有相同后缀的文件夹,但我想包含它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文