. gitignore does not work ignoring a subfolder of an ignored folder

1

I have tried to implement the solutions of: link

without success.

With the following in the gitignore , it does not ignore any subfolder or node_modules, example of my file:

  

! node_modules /

     

node_modules / *

     

! node_modules / node-dht-sensor-chip /

     

node_modules / *

     

node_modules / *

     

! node_modules / node-dht-sensor-chip /

     

! node-dht-sensor-chip /

     

! node_modules / node-dht-sensor-chip /

     

! node-dht-sensor-chip / *

     

! node-dht-sensor-chip /

     

With the following ignores everything in the node_modules folder, including node_modules

  

node_modules /

     

** / node_modules / *

     

! ** / node_modules / node-dht-sensor-chip /

    
asked by Yilber 16.05.2017 в 20:58
source

2 answers

1

Thank you very much. But I already solved the problem by creating a .gitignore inside the node_modules folder and simply put it in it:

  

*

     

! node-dht-sensor-chip / *

    
answered by 16.05.2017 / 21:38
source
1

It's okay what you say, but you created the .gitignore after the project was finished; you should clean the project cache git

git rm -r --cached .
git add .
git commit -m "Limpieza de Cache"  

merit link

    
answered by 16.05.2017 в 21:12