Published 2 min readGit

How to Ignore Files in Git Without Using .gitignore

Keep local-only files out of Git without touching the shared .gitignore: the repository-level .git/info/exclude file.

Local rules that never reach your teammates

Every Git repository has a .git/info/exclude file. It uses the same pattern syntax as .gitignore, but its rules apply only to your local clone and are never pushed to collaborators.

Open (or create) the file, add patterns for folders, file types or specific files, save it, and run git status to confirm the files are ignored.

.git/info/exclude
# local-only folder
my-notes/

# all log files
*.log

# a single file
config/local_settings.yml

Things to keep in mind

Files Git already tracks are not ignored automatically; remove them from tracking first. Prefer relative paths, and keep using .gitignore for rules the whole team should share.

All articles