[Solved] How to ignore a file in two diff directories in .gitignore


If you want to ignore only the two specific ones then add

backend/config.js
frontend/config.js

If you want to ignore all config files in subdirectories, as well as the directory that .gitignore is placed, add

**/config.js

In case you were tracking the mentioned files before and you would like to stop tracking them from now on, you can run git rm --cached <file name>

4

solved How to ignore a file in two diff directories in .gitignore