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

B Seven picture B Seven · Mar 16, 2012 · Viewed 53.1k times · Source

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

Answer

Mike Morearty picture Mike Morearty · Mar 16, 2012

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.