Git Ignore File

By Xah Lee. Date: . Last updated: .

You can set git to ignore some files, such as emacs backup files, compiled files.

Each git project dir top level should have a ignore file file named .gitignore. This file contains file name patterns that git should ignore.

Here's a sample content of git ignore file:

#-------------------
# emacs
*~
*.elc
[#]*[#]

#-------------------
# compiled files
*.com
*.class
*.dll
*.exe
*.o
*.so

#-------------------
# packed files
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

#-------------------
# Logs and databases
*.log
*.sql
*.sqlite

#-------------------
# OS junk
.DS_Store
__MACOSX/
._*
.Spotlight-V100
.Trashes
Thumbs.db

For detail, see git help gitignore.