Search code examples
gitversion-controlrepositorygitignore

Can you have additional .gitignore per directory within a single repo?


Can you create a .gitignore file in a directory that only applies to files (and directories) within that directory?


Solution

  • Yes, you can. Try it, it works fine. Put a .gitignore in the root of your repo, and put another .gitignore with additional things to ignore in a subdirectory.