move-ts icon indicating copy to clipboard operation
move-ts copied to clipboard

Use Git Mv

Open jelling opened this issue 6 years ago • 3 comments

This extension would be even better if it did a Git move either by default, or by configuration, when moving files. Right now it marks the old file name as deleted and adds a new file. This makes viewing the real history in Git much harder.

jelling avatar Sep 05 '18 21:09 jelling

I pretty sure git dpesn't record move in any special way; so shouldn't make a difference if you use git mv or not.

This SO question backs me up:- https://stackoverflow.com/questions/2314652/is-it-possible-to-move-rename-files-in-git-and-maintain-their-history

When you do moves;though you want to keep the other changes to the moved file as small as possible so the git rename detection 'magic' works.

rgammans avatar Mar 17 '19 11:03 rgammans

Even if it doesn't make a difference, there could be an option to do git mv (or git rm + git add) automatically, to avoid having to manually marking the file as moved later.

quezak avatar Sep 03 '19 15:09 quezak

@rgammans Using git mv does add both the deletion and the new file into the staging index, meaning that if you subsequently make changes to the new file, those changes are trivially kept separate from the move itself (until you stage the changes) and may make it easier create a commit history that maintains git's knowledge of the file history, even if you forgot to commit immediately after doing the rename.

csojinb avatar Dec 10 '19 17:12 csojinb