# Git Lock File Issue in Cursor (Mac)

**URL:** <https://forum.cursor.com/t/git-lock-file-issue-in-cursor-mac/154441>\
**Category:** Bug Reports\
**Tags:** macos\
**Created:** [March 11, 2026, 3:37pm UTC](https://forum.cursor.com/t/git-lock-file-issue-in-cursor-mac/154441 "2026-03-11T15:37:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JPeerSentry](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@JPeerSentry](https://forum.cursor.com/u/JPeerSentry)\
**Post date:** [March 11, 2026, 3:37pm UTC](https://forum.cursor.com/t/git-lock-file-issue-in-cursor-mac/154441/1 "2026-03-11T15:37:32Z")

</div>

### Where does the bug appear (feature/product)?

Cursor IDE

### Describe the Bug

It is basically the same as [Git Lock File Issue in Cursor](https://forum.cursor.com/t/git-lock-file-issue-in-cursor/149747) (but this got closed without any official statement)

The only difference is that this is happening on MacOS.

### Steps to Reproduce

Same as [Git Lock File Issue in Cursor](https://forum.cursor.com/t/git-lock-file-issue-in-cursor/149747)

1. Open a git repository in Cursor
2. Make some file changes
3. Attempt to stage changes via terminal: git add 
4. Observe error: lock file already exists

### Operating System

MacOS

### Version Information

MacOS: `15.7.4 (24G517)`

```auto
Version: 2.6.18 (Universal)
VSCode Version: 1.105.1
Commit: 68fbec5aed9da587d1c6a64172792f505bafa250
Date: 2026-03-10T02:01:17.430Z
Build Type: Stable
Release Track: Default
Electron: 39.6.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Darwin arm64 24.6.0

```

### Does this stop you from using Cursor

No - Cursor works, but with this issue

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [March 11, 2026, 5:07pm UTC](https://forum.cursor.com/t/git-lock-file-issue-in-cursor-mac/154441/4 "2026-03-11T17:07:41Z")

</div>

Hey, thanks for the report.

We’ve had reports of this on both Windows and macOS. We shipped a fix earlier, but it looks like it’s still happening on 2.6.18. I’m passing this back to the team again.

Here are a few workarounds that helped other users on macOS:

1. Switch Auto-Run Mode to “Ask Every Time”  
Cursor Settings \> Agents \> Auto-Run Mode \> “Ask Every Time”

A user in the [original thread](https://forum.cursor.com/t/git-lock-file-issue-in-cursor/149747/10) confirmed this fixes the `.git/index.lock` issue. It looks like the sandbox in auto mode is the trigger.

1. Disable terminal shell integration  
Settings `CMD + ,` \> search for `terminal.integrated.shellIntegration.enabled` \> set it to `false`

[Another user](https://forum.cursor.com/t/git-lock-file-issue-in-cursor/149747/8) fixed lock file issues this way.

1. Quick cleanup when it happens  
Fully quit Cursor (check Activity Monitor to make sure all processes are closed) \> delete `.git/index.lock` \> run your git commands \> reopen Cursor.

Quick question: does this happen when the agent runs git commands, or when you manually run `git add` in the terminal while Cursor is open? This will help narrow it down and figure out what exactly is triggering it.

---

<div class="post-metadata">

**Author:** ![JPeerSentry](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@JPeerSentry](https://forum.cursor.com/u/JPeerSentry)\
**Post date:** [March 11, 2026, 9:34pm UTC](https://forum.cursor.com/t/git-lock-file-issue-in-cursor-mac/154441/6 "2026-03-11T21:34:45Z")

</div>

Thanks for the quick response. I actually stick with solution #3 most of the time.

> does this happen when the agent runs git commands, or when you manually run `git add` in the terminal while Cursor is open? This will help narrow it down and figure out what exactly is triggering it.

It happens when I run `git add` (or other commands, like `git checkout` or `git commit`) manually. As I was interested I also tested the command inside Cursor and the agent had the same issue. FWIW I usually don’t run git commands in my agent, so I can’t say if it is the first time that it didn’t work inside the agent.

To my workflow, so you can narrow it down. I usually have multiple Cursor windows open, some of them are workspaces with 2-3 projects open. None of the agents run are running write git commands (some do use `git log`). My agent runs, I adapt the code, and on my mac terminal with oh my zsh (outside of Cursor) I run `git add` and then it fails (sometimes, but when it does it is almost persistent, unless I close Cursor).

I’m also happy to debug it together, as it is quite easy to reproduce on my end.

---

<div class="post-metadata">

**Author:** ![codaconda](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@codaconda](https://forum.cursor.com/u/codaconda)\
**Post date:** [March 24, 2026, 11:47am UTC](https://forum.cursor.com/t/git-lock-file-issue-in-cursor-mac/154441/7 "2026-03-24T11:47:04Z")

</div>

Have the same issue. Cannot fix: [Git Lock File Issue in Cursor (Mac) - #4 by deanrie](https://forum.cursor.com/t/git-lock-file-issue-in-cursor-mac/154441/4)

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [April 15, 2026, 11:47am UTC](https://forum.cursor.com/t/git-lock-file-issue-in-cursor-mac/154441/8 "2026-04-15T11:47:47Z")

</div>

Closed on April 15, 2026, 11:47am UTC

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.
