Poe Poe - 3 months ago 13
Git Question

Git: how to ignore hidden directories?

I'd like to have Git ignore all hidden files and directories, i.e.

.aptitude
,
.ssh/
and
.bash_rc
. Is there a simple rule to cover this without specifically adding each entry?

Answer

Just add a pattern to .gitignore

.*
!/.gitignore

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

Comments