Detect git repo in parent directory (AI Review, git indexing)

It looks like Cursor doesn’t look above the current workspace for a git repository (something that VS Code does for its other features), when it comes to the AI Review feature, as well as presumably the Git indexing feature. In a big monorepo, it’s common to open just a subfolder of the repo (e.g. frontend). So this would be a very useful addition - currently, it could even be considered a bug.

2 Likes

same issue: [Review] can't recognize git repository when open in subDirectory · Issue #1864 · getcursor/cursor · GitHub

I had to open another window to use the the AI review feature, so bad

for me, at remote workspace, thie feature doesn’t work at all

I ran into this issue and found the solution. The error occurs when your workspace root directory in Cursor doesn’t match where your .git directory is located.

Problem:

workspace_root/

└── project_folder/ ← .git is here

└── .git/

Solution:

When opening your project in Cursor, make sure to open the directory that contains the .git folder as your workspace root. In other words:

  • Close Cursor

  • Reopen Cursor

  • Select the directory that contains your .git folder as the workspace root