[英].gitignore un-ignore .cc files
I have a .gitignore
file in which I ignore everything, and then un-ignore specific files and directories. 我有一个
.gitignore
文件,其中我忽略所有内容,然后忽略特定的文件和目录。 However, one part of it doesn't seem to work. 但是,其中的一部分似乎不起作用。
/*
!.gitignore
!Makefile
!include/
!src/
!test/*.cc
**.swp
New *.cc
files in the test
directory don't appear in git status
. test
目录中的新*.cc
文件不会以git status
出现。
The /*
rule causes the test
directory to be ignored, so git never descends into it at all. /*
规则使test
目录被忽略,因此git绝对不会降入该目录。 Therefore your !test/*.cc
rule has no effect. 因此,您的
!test/*.cc
规则无效。
You need a sequence of alternating and overlapping rules like this: ignore everything, then un-ignore test
, then ignore everything under test
, then un-ignore the .cc
files within test
. 你需要交替的序列和重叠的规则是这样的:不顾一切,然后取消忽略
test
,则忽略下的一切test
,然后取消忽略.cc
中的文件test
。
/*
!test
test/*
!test/*.cc
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.