Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex .gitignore不在集合中的文件_Regex_Git_Set - Fatal编程技术网

Regex .gitignore不在集合中的文件

Regex .gitignore不在集合中的文件,regex,git,set,Regex,Git,Set,有没有办法通过在.gitignore中指定一组可接受的文件类型来限制git跟踪的文件类型 我希望能够限制提交到已编译目录的文件类型。我知道解析器不是正则表达式,但我想要这样的东西 !src/(*.js|*.html|*.css) 你可以这么做 src/* !src/*.js !src/*.css !src/*.html 不是真的。在此情况下,src/derp.xx不会被忽略rule@JRM对不起,我忘了忽略目录中的其他文件。编辑。

有没有办法通过在.gitignore中指定一组可接受的文件类型来限制git跟踪的文件类型

我希望能够限制提交到已编译目录的文件类型。我知道解析器不是正则表达式,但我想要这样的东西

!src/(*.js|*.html|*.css)
你可以这么做

src/*
!src/*.js
!src/*.css
!src/*.html

不是真的。在此情况下,src/derp.xx不会被忽略rule@JRM对不起,我忘了忽略目录中的其他文件。编辑。