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

前端 未结 1 1790
别跟我提以往
别跟我提以往 2020-12-04 06:13

I have a directory structure like this:

  • root
    • folder1
      • abc.json
      • def.json
      • somedir
        • more.json
相关标签:
1条回答
  • 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.

    http://schacon.github.com/git/gitignore.html

    *.json
    !spec/*.json
    
    0 讨论(0)
提交回复
热议问题