How to ignore all hidden directories/files recursively in a git repository?

Just add a pattern to .gitignore

.*
!/.gitignore

Edit: Added the .gitignore file itself (matters if it is not yet commited).

Leave a Comment