.gitignore exclusion is not working for a single file

前端 未结 3 1784
被撕碎了的回忆
被撕碎了的回忆 2021-01-04 06:44
$ git --version
git version 2.6.4

I realize this is a duplicate but the other question\'s answers have not helped.

Folder structure

3条回答
  •  粉色の甜心
    2021-01-04 07:13

    I has the similar problem with another .gitignore in subdirectory. For examaple:

    - root
    -- Subdir
    --- gulpfile.js
    --- .gitignore
    -- .gitignore
    

    In root .gitignore where two rules:

    *.js
    !gulpfile.js
    

    And in Subdir/gulpfile.js where another one rule:

    *.js
    

    Because of that, Subdir/gulpfile.js where ignored. To solve problem it is required to remove Subdir/.gitignore, or add !gulpfile.js to Subdir/.gitignore.

提交回复
热议问题