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.

If you have a question, put $5 at patreon and message me.

git

  1. Install git
  2. Git Basics
  3. Git Ignore File
  4. Commit Files
  5. Push to Server
  6. Pull from Server
  7. Find Difference
  8. View Log
  9. Revert Change
  10. Branching
  11. Temp Save: git stash
  12. What's HEAD
  13. FAQ