Context
I often move, rename files in Visual Studio 2022. Rename is a standard refactoring practice. However when I rename a file in Solution Explorer, not git mv operation is performed, instead git delete and git add.
This causes loosing the history of that particular file/class, which is a great loss in many cases.
Question
I can do the move operation leaving the IDE and using command line
git mv myoldfile.cs mynewfile.cs
which will keep history perfectly, but leaving the IDE is a productivity killer, especially when talking about refactoring and renaming multiple classes/files.
How to perform git mv within Visual Studio, instead of git delete and git add, when renaming, moving files in Solution Explorer?
gitdoes not have a concept of "move" or "rename". Remember: a git commit is a snapshot, not a diff/delta.git mvdoesn't store anything "special" or unique in your repo? A gitmvis identical to physically moving files yourself or by any other tool. That's why there's no IDE support for it: because it simply isn't needed.