Cursor does only find the .gitignore file in the codebase in every Project of mine

Describe the Bug

Cursor does only include the .gitignore file in the codebase index, I tried it in multiple projects (TypeScript, Go, and a newly created Next App *Screenshot).

git ls-files | wc -l results in 18.

Steps to Reproduce

Download Cursor
Install Cursor
Don’t Import any Settings
npx create-next-app@latest
cd <directory>
cursor .
Go to Settings > Features > Codebase Indexing
Click on Show Settings > See all included Files
Observe that only the .gitignore file is present

Expected Behavior

Cursor should have all available files (if not ignored by .cursorignore or .gitignore) in it’s codebase index.

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 0.44.9
VSCode Version: 1.93.1
Commit: 316e524257c2ea23b755332b0a72c50cf23e1b00
Date: 2024-12-26T21:58:59.149Z
Electron: 30.5.1
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Darwin arm64 24.2.0

Additional Information

The Codebase Feature is the one thing that would really interest me and bring that tool into my company, but without it I kind of can’t test cursor properly.

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, I followed the steps you described, and it indexed successfully for me. Have you tried deleting the index and re-indexing it?

Thanks for reproducing it, I tried deleting it and reindexing. Also tried to remove cursor completely and other projects. No positive result by now. :frowning:

Hey, if you open the ‘Output’ panel (CMD+Shift+U) and check the Cursor Indexing tab, can you send over the logs from in here?

My guess is that something is blocking Cursor from seeing the files, and the error may (hopefully) show up in this tab.

Hey @danperks, Thanks for looking into it.

These are the logs when I open cursor in the project:

2024-12-28 20:29:46.605 [info] Creating Indexing Repo client:  https://repo42.cursor.sh
2024-12-28 20:29:46.605 [error] Git command failed: git config --get remote.origin.url Command failed: git config --get remote.origin.url

2024-12-28 20:29:46.605 [error] Error getting repo info: Command failed: git config --get remote.origin.url

2024-12-28 20:29:46.605 [error] Error: Command failed: git config --get remote.origin.url

	at genericNodeError (node:internal/errors:984:15)
	at wrappedFn (node:internal/errors:538:14)
	at ChildProcess.exithandler (node:child_process:422:12)
	at ChildProcess.emit (node:events:519:28)
	at maybeClose (node:internal/child_process:1105:16)
	at Socket.<anonymous> (node:internal/child_process:457:11)
	at Socket.emit (node:events:519:28)
	at Pipe.<anonymous> (node:net:339:12)
2024-12-28 20:29:46.845 [info] InternalRepoInfo constructor with preferredEmbeddingModel 0
2024-12-28 20:29:46.856 [info] Creating merkle client.
2024-12-28 20:29:46.856 [info] Done creating merkle client.
2024-12-28 20:29:46.856 [info] Doing a startup handshake.
2024-12-28 20:29:46.896 [info] Finished initializing merkle tree in 21.363916000000017 ms.
2024-12-28 20:29:46.897 [info] Doing the initial handshake with hash: 680cf939c8c0688535295852cfd6fea848d10afc13c25a16c3e2c2964d70215a
2024-12-28 20:29:46.901 [info] Handshake start
2024-12-28 20:29:47.352 [info] Handshake timing: 453.30708300000015
2024-12-28 20:29:47.352 [info] Handshake result: {"status":"STATUS_UP_TO_DATE","repoName":"4c2ba55e-f38f-46b3-970c-8ebceca7df8d"}
2024-12-28 20:29:47.353 [info] Starting fast remote sync.
2024-12-28 20:29:47.354 [info] Total num embeddable files: 1
2024-12-28 20:29:47.354 [info] Root hash: 680cf939c8c0688535295852cfd6fea848d10afc13c25a16c3e2c2964d70215a
2024-12-28 20:29:47.354 [info] Finished indexing repository.
2024-12-28 20:29:47.354 [info] Indexing job successfully done or aborted.
2024-12-28 20:29:48.055 [info] Creating Indexing Repo client:  https://repo42.cursor.sh
2024-12-28 20:29:48.057 [info] InternalRepoInfo constructor with preferredEmbeddingModel 0
2024-12-28 20:29:48.059 [info] Creating merkle client.
2024-12-28 20:29:48.059 [info] Done creating merkle client.
2024-12-28 20:29:48.059 [info] Doing a startup handshake.
2024-12-28 20:29:48.071 [info] Finished initializing merkle tree in 4.12704100000019 ms.
2024-12-28 20:29:48.071 [info] Doing the initial handshake with hash: 680cf939c8c0688535295852cfd6fea848d10afc13c25a16c3e2c2964d70215a
2024-12-28 20:29:48.072 [info] Handshake start
2024-12-28 20:29:48.519 [info] Handshake timing: 447.86791700000003
2024-12-28 20:29:48.519 [info] Handshake result: {"status":"STATUS_UP_TO_DATE","repoName":"4c2ba55e-f38f-46b3-970c-8ebceca7df8d"}
2024-12-28 20:29:48.520 [info] Starting fast remote sync.
2024-12-28 20:29:48.520 [info] Total num embeddable files: 1
2024-12-28 20:29:48.521 [info] Root hash: 680cf939c8c0688535295852cfd6fea848d10afc13c25a16c3e2c2964d70215a
2024-12-28 20:29:48.521 [info] Finished indexing repository.
2024-12-28 20:29:48.521 [info] Indexing job successfully done or aborted.

I also did another log, I delete the logs before, then deleted the index and computed the index:

2024-12-28 20:31:26.964 [info] InternalRepoInfo constructor with preferredEmbeddingModel 0
2024-12-28 20:32:04.731 [info] InternalRepoInfo constructor with preferredEmbeddingModel 0
2024-12-28 20:32:04.731 [info] Setting indexing intent to should-index
2024-12-28 20:32:04.731 [info] InternalRepoInfo constructor with preferredEmbeddingModel 0
2024-12-28 20:32:04.732 [info] Creating merkle client.
2024-12-28 20:32:04.732 [info] Done creating merkle client.
2024-12-28 20:32:04.732 [info] Doing a startup handshake.
2024-12-28 20:32:04.744 [info] Finished initializing merkle tree in 4.2025830000056885 ms.
2024-12-28 20:32:04.744 [info] Doing the initial handshake with hash: 680cf939c8c0688535295852cfd6fea848d10afc13c25a16c3e2c2964d70215a
2024-12-28 20:32:04.745 [info] Handshake start
2024-12-28 20:32:04.927 [info] Handshake timing: 183.08058399998117
2024-12-28 20:32:04.928 [info] Handshake result: {"status":"STATUS_EMPTY","repoName":"4c2ba55e-f38f-46b3-970c-8ebceca7df8d"}
2024-12-28 20:32:04.928 [info] Starting fast remote sync.
2024-12-28 20:32:04.928 [info] Total num embeddable files: 1
2024-12-28 20:32:04.929 [info] Root hash: 680cf939c8c0688535295852cfd6fea848d10afc13c25a16c3e2c2964d70215a
2024-12-28 20:32:04.929 [info] Starting repository upload from scratch.
2024-12-28 20:32:04.929 [info] Uploading 1 files.
2024-12-28 20:32:05.662 [info] Finished indexing repository.
2024-12-28 20:32:05.662 [info] Indexing job successfully done or aborted.

Both times I only have .gitignore in my embeddable_files.txt.

Still having the problem, any ideas?

I found the issue, I had a .gitignore like this in my ~ directory:

*
!.gitignore

!.config/

!.config/tmux
!.config/tmux/tmux.conf

!.config/alacritty
!.config/alacritty/alacritty.toml

!.config/oh-my-posh
!.config/oh-my-posh/zen.toml

And the projects I tried to run with cursor were located in ~/workspace/repositories/git or ~/workspace/playground. Seems like Cursor goes recursively up all the directories to collect .gitignore’s, this behaviour slightly differs from the default git behaviour I assume.

Thanks for the help,

1 Like

Sorry for the delay, and glad you found a fix!

I’ll make a note of this and bring it up with the team to confirm how Cursor behaves in this situation is as we expect!