VS Code extension that automatically stages file renames as git mv when you move files in the Explorer — so git sees a rename (R) instead of a delete + untracked file (D + ??).
Works alongside VS Code's built-in "Update imports?" prompt — this extension only handles the git side.
Note: Set Update Imports on File Move to
prompt(notalways) in your VS Code settings. Withprompt, VS Code shows a confirmation popup after the rename, giving this extension time to finish staging before you confirm. Withalways, VS Code applies import updates in the same event tick as the rename and the two can conflict, causing imports to not be updated.
How it works
When you move or rename a tracked file in the VS Code Explorer:
- VS Code moves the file on disk as usual
- This extension runs the equivalent of
git mvby staging the rename in the git index:git rm --cached <old path>git add <new path>
git statusnow showsR old -> newinstead ofD old+?? new
Untracked files and non-git repos are silently skipped.
Settings
| Setting | Default | Description |
|---|---|---|
gitMove.enabled |
true |
Enable/disable the extension without uninstalling |
gitMove.showNotifications |
false |
Show a toast notification each time a rename is staged |