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. Like this:


Purpose of Git Ignore File

.gitignore file contains file name patterns that git should ignore.

Sample Git Ignore File

Here's a sample content of git ignore file:

# emacs

# compiled files

# packed files

# Logs and databases

# OS junk

For detail, type in terminal git help gitignore