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

**URL:** <https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220>\
**Category:** Feature Requests\
**Created:** [September 17, 2024, 9:08pm UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220 "2024-09-17T21:08:49Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![judehunterdev](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/judehunterdev/32/5183_2.png) [@judehunterdev](https://forum.cursor.com/u/judehunterdev)\
**Post date:** [September 17, 2024, 9:08pm UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/1 "2024-09-17T21:08:49Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/cursor1/original/2X/0/0d763980fb98913d40202c034602ebf663359408.png)

---

<div class="post-metadata">

**Author:** ![YuTengjing](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/yutengjing/32/3704_2.png) [@YuTengjing](https://forum.cursor.com/u/YuTengjing)\
**Post date:** [September 22, 2024, 7:39pm UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/2 "2024-09-22T19:39:55Z")

</div>

same issue: [[Review] can't recognize git repository when open in subDirectory · Issue #1864 · getcursor/cursor · GitHub](https://github.com/getcursor/cursor/issues/1864)

---

<div class="post-metadata">

**Author:** ![YuTengjing](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/yutengjing/32/3704_2.png) [@YuTengjing](https://forum.cursor.com/u/YuTengjing)\
**Post date:** [September 22, 2024, 7:41pm UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/3 "2024-09-22T19:41:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![loomino-brkh](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@loomino-brkh](https://forum.cursor.com/u/loomino-brkh)\
**Post date:** [October 14, 2024, 10:06am UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/4 "2024-10-14T10:06:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nodje1z](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/nodje1z/32/10662_2.png) [@nodje1z](https://forum.cursor.com/u/nodje1z)\
**Post date:** [November 3, 2024, 3:30pm UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/5 "2024-11-03T15:30:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![YuTengjing](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/yutengjing/32/3704_2.png) [@YuTengjing](https://forum.cursor.com/u/YuTengjing)\
**Post date:** [November 25, 2024, 4:17pm UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/6 "2024-11-25T16:17:00Z")

</div>

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

@truell20 @shaoruu @ericzakariasson @danperks @ericzakariasson

---

<div class="post-metadata">

**Author:** ![dkelly99](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/dkelly99/32/42754_2.png) [@dkelly99](https://forum.cursor.com/u/dkelly99)\
**Post date:** [March 31, 2025, 10:57am UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/7 "2025-03-31T10:57:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pulsedemon](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/pulsedemon/32/56600_2.png) [@pulsedemon](https://forum.cursor.com/u/pulsedemon)\
**Post date:** [May 20, 2025, 5:20pm UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/8 "2025-05-20T17:20:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![condor](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/condor/32/73148_2.png) [@condor](https://forum.cursor.com/u/condor)\
**Post date:** [May 21, 2025, 2:27am UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/9 "2025-05-21T02:27:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pulsedemon](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/pulsedemon/32/56600_2.png) [@pulsedemon](https://forum.cursor.com/u/pulsedemon)\
**Post date:** [May 25, 2025, 12:24am UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/10 "2025-05-25T00:24:01Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![condor](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/condor/32/73148_2.png) [@condor](https://forum.cursor.com/u/condor)\
**Post date:** [May 25, 2025, 9:28am UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/11 "2025-05-25T09:28:16Z")

</div>

@deanrie is this a known limitation of Workspaces?

---

<div class="post-metadata">

**Author:** ![tommed](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/tommed/32/63160_2.png) [@tommed](https://forum.cursor.com/u/tommed)\
**Post date:** [June 12, 2025, 2:50pm UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/12 "2025-06-12T14:50:55Z")

</div>

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`).

---

<div class="post-metadata">

**Author:** ![Crlme14](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@Crlme14](https://forum.cursor.com/u/Crlme14)\
**Post date:** [September 22, 2025, 7:36am UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/13 "2025-09-22T07:36:34Z")

</div>

This problem is still happening. Please, a fix for this would make my life a lot better 🙏.

---

<div class="post-metadata">

**Author:** ![gerbz](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/gerbz/32/123375_2.png) [@gerbz](https://forum.cursor.com/u/gerbz)\
**Post date:** [January 12, 2026, 9:21pm UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/14 "2026-01-12T21:21:31Z")

</div>

This is an issue for me as well. I can’t utilize worktrees 😭 My setup is:

- workspace
  - /private
  - /public
    - .git

VSCode has a `git.repositoryScanMaxDepth` setting for scanning extra directories. Works great for git. Maybe cursor could just utilize it? Mine is set as:

- “git.repositoryScanMaxDepth”: 2

---

<div class="post-metadata">

**Author:** ![gerbz](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/gerbz/32/123375_2.png) [@gerbz](https://forum.cursor.com/u/gerbz)\
**Post date:** [February 7, 2026, 7:07pm UTC](https://forum.cursor.com/t/detect-git-repo-in-parent-directory-ai-review-git-indexing/17220/15 "2026-02-07T19:07:30Z")

</div>

@deanrie can you take a look? Source control utilizes `git.repositoryScanMaxDepth` so would be great if agents did as well.
