.gitignore && .cursorignore - please do not mix

I am using both .gitignore and a .cursorignore file. I want to be sure the Cursor development team is aware of my position, that the two filles do not become mixed purpose for the Cursor project.

I do not want my .gitignore to be read as an ignore list by Cursor, because I have a LOT of reference/library code I am working with. Plus my own orphan code I have abandoned, but not discarded.

The reference code libraries I am using are not intended to be used as a source of code for the project, and thus not written to my git repository, and are far too big for that to even be possible. So they comprise part of .gitignore, but not .cursorignore

Therefore, I want .gitignore to be ignored by cursor and have .cursorignore to the only ā€˜Source of Truth’ for Cursor exclusions.

So please don’t repurpose .gitignore as an ignore list for cursor. That will really screw me up and totally mess up the incredible power of having larger reference code libraries in my local development environment.

I am wriiting this post because I saw a comment by a dev team member that they might ASSUME .gitignore should be a source of truth for Cursor. Please do not do that.

3 Likes

Your use case makes sense.

But there is a use case where it might make sense for .gitignore to be respected as .cursorignore is — enterprise security. The .gitignore (already present in a well-defined project to prevent committing "a secrets file"¹) allows an additional² ā€œby defaultā€ security layer between sensitive data and Cursor’s server.

Also, the relationship between .gitignore and .cursorignore seems similar to .gitignore and .dockerignore and to .gitignore and .npmignore.

¹ An example of a secrets file would be a Python file in a Django project that has sensitive settings, separate from a settings.py.

² Another obvious layer being privacy mode.

3 Likes

I understand that by default cursorignore use gitignore.

But, honestly, they serve different purposes and we should have at least an option to :

  • disable gitignore for indexing
  • force indexing of specific folder disabled by gitignore

If I can’t index vendor files on which I should work with, cursor has no clue of my context and don’t serve any purpose anymore.

Or maybe I am missing something, because it seems so incredible to not being able to index the folders we want.

Ok, just understood that .cursorignore CAN OVERRIDE .gitignore for inclusion.

Just add:

!/path/to/folder/gitignored/to/index/*
!/path/to/folder/gitignored/to/index/**/*

Yes, Agreed. I found the negative inclusion syntax after I opened this thread. I can still argue that its counter intuitive to have to do negative inclusions, in the first place, because I use a lot of code for research and reference, my .gitignore was extensive.

In the big picture this is a minor point.