How to force Cursor to index files/folders in gitignore

It is understanding Cursor doesn’t make indexing for those in .cursorindexingignore configuration. However, Cursor also ignore all files in .gitignore configuration, it doesn’t index or have visibility for them.

I write the files in .gitignore only to avoid unnecessary including in my repository but these files could be useful for context awareness, is there a way to make Cursor take them into reference? I appreiciate.

Hey, try removing it from this list.

image

Actually it doesn’t appear in Global Cursor Ignore List at all. Here I explain my use case more, in my working directory, there is a sub-folder named “reference_src”, which includes necessary code for Cursor‘s reference in order to have better context, but “reference_src” is not part of my application and I don’t want it visible in git repository, the only way I can do is to add “reference_src” folder in .gitignore hence it causes Cursor to ignore it in indexing or any other kind of context code reference.

Ah, I misunderstood you. You need the directory to be indexed but not included in your repository. You just need to create a .cursorindexingignore file if it doesn’t exist yet and add the following line in your case: !path/to/folder. This way, that folder will be indexed by Cursor.

Thank you, it works!

1 Like

Did this solution regress? I’m finding that negation works in .gitignore but .cursorindexingignore doesn’t seem to allow negating .gitignore.

My example:

.gitignore:
ai_context_dumps/sentry/*

.cursorindexingignore:
!ai_context_dumps/sentry/event_b76e572a27ec48c28db0597ecf07d82a.json

That event json never indexes. If i include that line into .gitgnore though, it does index.

Edit: Upon further investigation, that file is in embeddable_files.txt.. however file search nor @ mentions can find it.. even after cursor restart. I would assume that all files in embeddable_files.txt should be found correct? Feels like it’s not a .cursorignore config bug but an indexing one.