Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git ignore all files of a certain type, except those in a specific subfolder

Tags:

git

gitignore

An optional prefix ! which negates the pattern; any matching file excluded by a previous pattern will become included again. If a negated pattern matches, this will override lower precedence patterns sources.

https://git-scm.com/docs/gitignore

*.json
!spec/*.json