No option to disable global or parent .gitignore files — affects indexing behavior

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

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:

"search.useGlobalIgnoreFiles": false,
"search.useParentIgnoreFiles": false

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:

  • Global .gitignore (e.g., ~/.gitignore)
  • Parent directory .gitignore files

Example configuration suggestion:

"cursor.useGlobalIgnoreFiles": false,
"cursor.useParentIgnoreFiles": false

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.7.54
VSCode Version: 1.99.3
OS: Linux x64 6.8.0-86-generic

Does this stop you from using Cursor

Yes - Cursor is unusable

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:

git config --global core.excludesfile ~/.gitignore_global

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.

1 Like

Thanks for the detailed clarifications. That helped me find the root cause.

You’re right, Cursor reads ~/.gitignore directly instead of honoring the Git configuration (core.excludesfile pointing to ~/.gitignore_global).

I’ll pass this to the team. For now, temporarily renaming ~/.gitignore when working in Cursor is unfortunately the only option.

I talked to the team. It’s not actually a bug. It fits better as a feature request. Could you create a request for this feature?