is it possible to ignore .gitignore rules in subdirectory?

Your question isn't too clear, but if there are some subdirectories where you want different gitignore rules, you can just create a new .gitignore in that directory.

Say you have:

project/.gitignore
project/stuff/.gitignore

The .gitignore in stuff/ will override the .gitignore in the root directory.

git help gitignore or man gitignore has quite a bit more information about what's possible.


Lets say you want to include node_modules in your repository, but some module down the line has .gitignore of its own. You can negate the rules by adding the following to your root .gitignore file:

# Make sure to include everything in node_modules.
!node_modules/**