In most operating systems by default, files that start with a period (.) are hidden. When setting up my .gitignore file, I like to ignore all these hidden files (with a few exceptions).
gitignore All Hidden Files
By adding the following line to my .gitignore file, all files that start with a period (.) will be ignored.
.*
Add Exceptions
There are some files that start with a period (.) that I do want to include in my Git repository (e.g. .gitignore).
I can add these exceptions using an exclamation point (!) in .gitignore (in many languages the exclamation point is the NOT operator).
!.gitignore
Leave a Reply