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 /