In the documentation, it is said:
Cursor will also ignore all files listed in the .gitignore file in your root directory and in the > Default Ignore List provided below.
To not ignore a file listed in these files, add it to your .cursorignore file with an ! prefix.
Problem: It doesn’t work. If a file is ignored in .gitignore
, it won’t appear in the Workspace explorer (and likely not in the codebase index as well) even if you explicitly asked to include it in .cursorignore
. Cursor doesn’t honor the !
prefix in neither .gitignore
or .cursorignore
.
Configuration:
Version: 0.49.4
VSCode Version: 1.96.2
Commit: ec408037b24566b11e6132c58bbe6ad27046eb90
Date: 2025-04-22T00:17:03.731Z
Electron: 34.3.4
Chromium: 132.0.6834.210
Node.js: 20.18.3
V8: 13.2.152.41-electron.0
OS: Linux x64 6.8.0-58-generic
Test 1:
.gitignore
:
* # (ignore everything)
.cursorignore
:
# empty
- Expected: workspace explorer should be empty.
- Result: workspace explorer is empty
(expected)
Double checking
$ git check-ignore -v api
.gitignore:1:* api
Test 2:
.gitignore
:
* # (ignore everything)
!api # except the api folder
.cursorignore
:
# empty
- Expected: workspace explorer should show
api
folder. - Result: workspace explorer is still empty
(
)
Note: Reloading Developer Window doesn’t help: it doesn’t show.
Double checking to confirm that the .gitignore
rule works as intended:
$ git check-ignore -v api
.gitignore:2:!api api
More information
-
Adding
!api
to.cursorignore
has no effect:
-
Even a direct test (without the
*
) doesn’t work: theapi
folder doesn’t show in the explorer, proving that Cursor doesn’t honor the!
prefix in neither.gitignore
or.cursorignore
.
cc @ericzakariasson that I’ve seen being helpful on .cursorignore
related reported issue