Bug Report: Git Rebase Lock File .lockd Issue Preventing Operation Completion

Bug Report: Git Rebase Lock File .lockd Issue Preventing Operation Completion


Clear Description of the Bug:

When performing a git rebase -i operation, I encountered an issue with the .lockd lock file. Even when there are no uncommitted changes, I was unable to complete the Git rebase operation due to an error regarding the lock file (.git/HEAD.lock). This issue seems to be related to how the cursor tool interacts with Git and handles staging or lock files.

How to Reproduce:

  1. Open the Git project directory.
  2. Run the interactive rebase command:
git rebase -i HEAD~7
  1. The following error message is shown:
error: update_ref failed for ref 'refs/heads/master': cannot lock ref 'HEAD': Unable to create 'C:/code/app/.git/HEAD.lock': File exists. Another git process seems to be running in this repository, e.g., an editor opened by 'git commit'.
  1. Despite cleaning up the repository using git gc --prune=now and git fsck, the error persists. The operation cannot proceed as expected.

Operating System and Cursor Version:

  • Operating System: Windows 11
  • Cursor Version: 0.44.11

Impact on Workflow:

This issue prevents the git rebase operation from completing successfully, which blocks further progress on the Git history reorganization. While the issue does not affect basic Git operations, it prevents me from using rebase to adjust commit history.

Attachments:

  • Screenshots or recordings: [Attach any relevant screenshots or error messages]

Additional Information:

  • The .lockd error occurs only when using the cursor tool; normal Git operations do not trigger this error.
  • I have ensured that all working directory changes are committed or staged prior to running the rebase command.
  • Despite removing the .git/HEAD.lock file manually, the error persists and the rebase operation remains blocked.

Summary:

This bug seems related to how cursor manages Git lock files during interactive rebase operations. A solution or workaround would be helpful to avoid the .lockd file issue and allow smooth rebase operations.


Hey, does this still have issues if you close and reopen Cursor?

Also, if you try to do this in the terminal, with Cursor closed, does everything work as expected?

Thank you for looking into this issue. Based on my observations, it seems to be an intermittent problem. I’ve found that submissions are generally successful when Cursor is reloading the file list, but the issue typically occurs during the initial submission, when the /.git/HEAD.lock file is locked. Even after I delete the lock file through Cursor’s terminal, the issue persists.

I hope this information helps with the investigation. Thank you for continuing to look into this issue!

Just to check, do you have any Git related extensions running on your Cursor install? I haven’t seen any other reports of this myself, so I’d be surprised if Cursor was causing the lock file to exist on its own.