Git: how to ignore hidden files / dot files / files with empty file names via .gitignore?

git, gitignore

Solution

If you want to ignore all dotfiles, add this in your .gitignore file (If it doesn't exist, add it)

.*
!.gitignore

Problem

These files should all be ignored: ``` .weirdBackupFileType .travis.yml ``` The following files should not be ignored: ``` _.weirdBackupFileType Z.travis.yml ```

Original source

Related problems