Renaming files took them out from version control

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I asked cursor to rename a bunch of files, to have the name ‘Test’ in their name, so that they are properly picked up by PHPUnit to be tested. It seems that Cursor created new files and deleted the old ones, resulting in the files no longer being under source control.

Steps to Reproduce

I am not going to attempt that, for obvious reasons.

Expected Behavior

Renaming files shouldn’t remove them from version control.

Operating System

MacOS

Version Information

Version: 2.4.36
VSCode Version: 1.105.1
Commit: f9919bf991f247689f9ead605b5c5a3239a2a790
Date: 2026-02-12T21:00:33.976Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Darwin arm64 25.2.0

For AI issues: which model did you use?

Was using ‘auto’

For AI issues: add Request ID with privacy disabled

e471ab61-6868-4912-b409-16ef0b448c62

Additional Information

I still have the cursor window open, and am going for a long walk. If you want me to try anything on this end.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report.

This is a known issue. The agent is currently doing renames as “create new + delete old” instead of using git mv, which breaks file history in version control. The team is aware and tracking it.

A few tips for now:

  1. If you still have the window open, try reverting the agent’s changes using checkpoints (click the checkpoint restore button in chat), then do the renames manually with git mv in the terminal.

  2. Even if you’ve already committed, Git is usually smart enough to detect renames if the file contents didn’t change much. Running git log --follow <new-file-name> will still track history in most cases.

  3. As a workaround for future renames, you can explicitly tell the agent to “use git mv in the terminal”. This forces it to use the terminal tool instead of create/delete file operations.

Let me know if any of this helps.

Ooof. Thanks for the reply. That is quite the gotcha.

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