Git Ignore File

By Xah Lee. Date: . Last updated: .

What is Git Ignore File

Git Ignore File (.gitignore) is a file containing lines of patterns that tells git which files should be ignored. e.g. emacs backup files~, auto generated compiled files, log files, cache files, etc.

Where is Git Ignore File

Git Ignore File is named .gitignore

If it exist, it is at each git project dir top level. For example:

# project dir


Sample Git Ignore File

Here's a sample content of git ignore file:

# emacs

# compiled files

# packed files

# Logs and databases

# macOS junk files

# Microsoft Windows junk files

For detail, type in terminal git help gitignore


git FAQ