Currently, Cursor automatically applies .gitignore rules from directories above the project root (including ~/.gitignore or parent folders).
This behavior directly impacts codebase indexing, as files that should be part of the project context are excluded unintentionally.
In VS Code, there are explicit settings to control this — such as:
Cursor, however, lacks similar configuration options.
As a result, users cannot prevent Cursor from inheriting global or parent .gitignore rules, which can lead to incomplete or incorrect indexing for AI features.
Steps to Reproduce
Indexing 100% - 0 files
Expected Behavior
Expected behavior:
Cursor should provide settings to disable or override the use of:
Hey, thanks for the report. This is a valid concern about how Cursor handles .gitignore files.
To help with diagnostics, please share:
The contents of your ~/.gitignore and any .gitignore files in parent directories (to see what’s being excluded)
The result in Cursor Settings → Indexing & Docs → “View included files” — does it show 0 files or specific exclusions?
Whether you tried creating a .cursorignore in the project root and adding explicit include rules (this may not override the global .gitignore)
Potential workaround: temporarily rename your ~/.gitignore, restart Cursor, and check if indexing starts. This isn’t a permanent fix, but it helps confirm the cause.
Thanks for the quick follow-up! Let me clarify my setup — this might explain why the issue occurs.
I keep various configuration files, environment settings, custom scripts, Bash aliases, and other personal workspace files in a separate, standalone Git repository located in my home directory.
Naturally, this directory contains its own .git folder and a .gitignore file with the following rule:
*
This is intentional — I only add files to that repository manually when I need to track them. It’s a convenient way to manage my development environment.
However, my actual Git configuration uses a different ignore list entirely:
So, ~/.gitignore is formally disabled in my Git setup.
Cursor, however, seems to behave differently — it doesn’t respect the Git configuration and instead directly reads ~/.gitignore, completely ignoring ~/.gitignore_global.
As a result, Cursor indexes 0 files, since the * rule in ~/.gitignore excludes everything.
Of course, renaming or deleting ~/.gitignore makes indexing work again — but that’s clearly just a temporary workaround. The IDE behavior is incorrect, since it disregards actual Git configuration and applies .gitignore rules on its own.