Use one of these templates:
# ignore all . files and . folders .*
What is this pattern?
.* - This patter tells git to ignore all files starting with .
! . This tells git not to ignore the pattern. In your case /.gitignore
You can find a demo in this answer:
Git: how to ignore hidden files / point files / files with empty file names via .gitignore?
Codewizard
source share