I have two branches which contain their own version of node_modules, but in different folders.
Branch 1:
--client/
--server/
--node_modules/
...
Branch 2:
--server/
-----/node_modules/
...
So, when I switched from Branch 2 -> Branch 1, it contained the following folders:
--client/
--server/
-----/node_modules/
--node_modules/
...
This made an error because Node will use the nested version instead of the outer one. So, my question is how to disappear files specified in .gitignore, for example node_modules in this case, when checking out another branch?
 
     
    