Drag to move file/folder doesn't trigger git mv

In VSCode, dragging a folder or file to a new location updates the imports and performs a git mv in the background, preserving the file’s history.

In Cursor, however, this action deletes the file and creates a new one in the new location, resulting in a loss of the file’s Git history.

1 Like

Hey, if you open the Source Control tab on the left, and then the “File History” section, you can click the context menu and enable “Toggle Follow Renames” there. Does that fix the issue?

@danperks the trouble is rather deeper in default settings on agentic side.
All the time i do refactoring (no matter claude or gemini) the files are mv’ed instead of being git mv’ed
Remarkably, the agent is aware of git usage both because of current chat history and because of .git directory presence

Ah, understood.

You can force the behaviour here using Project Rules, as you can specify to the agent that it should use the right command when it’s moving files around!

Give that a try and do let me know how you get on.

Saw your reply just now!
I don’t have this ‘File History’ section inside my Source Control tab, but, I saw now that after I commit my changes the change take in place as git mv! so no problem here finally!