English / 日本語
Table of Contents:
Overview
This extension provides a git mv operation using a native file save dialog.
When a file is moved, any editors referring to the original path are reopened with the new file path.
Background
VSCode's built-in Git: Rename command performs a git mv under the hood and automatically updates open editors. However, it does not support directory name completion, nor does it allow creating new folders, making it unsuitable for moving files across directories.
On the other hand, running git mv from a terminal allows for tab completion, reducing the risk of mistyped paths. But this leaves VSCode with editors pointing to deleted files, and still requires a manual mkdir if the destination folder doesn't exist.
This extension solves both issues by allowing git mv operations through the file save dialog.
This provides:
- directory browsing and creation
- error-free path selection using a native UI
- automatic reopening of all affected editors with the new file path
As a result, it prevents mistakes like editing and saving an old buffer after a file rename.
Usage
Use from Command Palette
- Focus the editor of the file you'd like to move with
git mv
- Open the Command Palette and type
git mv
- Select
git mv: with file save dialog
- Choose a destination file name from the save dialog
- In Explorer, select one or more files/folders you want to move
- Right-click and choose
git mv: with save dialog
- For a single file, choose a destination file path in the save dialog
- For a single folder or multiple targets, choose a destination directory in the folder picker
Notes
- If selected files/folders have a parent-child relationship, child entries take precedence, and parent or ancestor folders are treated as unselected
- If you run the command from a blank area in Explorer, it is handled as having no target
- If untracked files are included under a selected folder, they are also moved. This is due to the behavior of the
git mv command.
- If selected files are not managed by Git, they are ignored
Bug Reports and Feature Requests
If you encounter any bugs or have any suggestions, please let us know by submitting an issue on our GitHub page.
Appendix
Feature Comparison
|
git mv (CLI) |
Git: Rename (VSCode) |
git mv: with save dialog (this extension) |
| Updates open editors |
❌ |
✅ |
✅ |
| Create directories |
❌ |
❌ |
✅ |
| Move across folders |
✅[^1] |
⚠️[^2] |
✅ |
[^1]: Practical if you're comfortable with the CLI
[^2]: Tab completion is not supported in the input field, making it error-prone