Git Lock File Issue in Cursor (Mac)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

It is basically the same as Git Lock File Issue in Cursor (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

  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)

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

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

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.

Have the same issue. Cannot fix: Git Lock File Issue in Cursor (Mac) - #4 by deanrie

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