What's the difference between `files.exclude` and `.gitignore`?

Responsive Ad Header

Question

Grade: Education Subject: Support
What's the difference between `files.exclude` and `.gitignore`?
Asked by:
63 Viewed 63 Answers

Answer (63)

Best Answer
(303)
`files.exclude` is a VS Code setting that controls which files are hidden in the Explorer and ignored during indexing. `.gitignore` is a Git setting that controls which files are excluded from being tracked by Git. While they can overlap, they serve different purposes and operate in different contexts.