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

Please fix this, ai review is useless for monoropo project to open single sub repo now

@truell20 @shaoruu @ericzakariasson @danperks @ericzakariasson

I think this is really a bug, not a feature request. In “Bug Finder”, I get the following error:

No current branch found. Please ensure you are in a git repository and try again.

We use a monorepo so I work from a subfolder of the repo. I can get it to work if I open a separate instance of Cursor in the root of the monorepo but this is not a good solution.

This is a problem. I work with monorepos and I do not want to open the root directory since I don’t care about any of the code outside of the project i’m working on.

1 Like

Cursor 0.50 supports workspaces with multiple projects. this would likely fit your monorepo and you can configure each project and they can have their own cursor rules etc.

nope. If i open a subdirectory in the monorepo I lose all git functionality. Works fine in vscode, so why doesn’t cursor also support the same functionality as its a fork?

1 Like

@deanrie is this a known limitation of Workspaces?

I would also really like to see this working. Having the entire monorepo open at once is not ideal. I’d like to focus on one component and have the rest of the code outside of the context window. Having support for the parent directory structure containing the .git folder would be amazing. (e.g., support for root/src/component1).