4 ms·
As the Git FAQ [0] says: > Git has a rename command git mv, but that is just for convenience. The effect is indistinguishable from removing the file and adding
by danarmak 8y ago
As the Git FAQ [0] says:
> Git has a rename command git mv, but that is just for convenience. The effect is indistinguishable from removing the file and adding another with different name and the same content.
git diff, merge, and related tools have heuristics for detecting file moves (off by default, turned on with e.g. git diff -M) but they tend to break if a file is both moved and modified in the same commit.
[0] https://git.wiki.kernel.org/index.php/GitFaq#Why_does_Git_not_.22track.22_renames.3F https://git.wiki.kernel.org/index.php/GitFaq#Why_does_Git_no...
- markbnj 8y agoYeah exactly why I always commit renames right away and atomically. I mean it's a _relatively_ rare thing and when I have to do it I just want to make and record the change and then move on. Renaming and then modifying a file in the same commit is slightly sloppy imo. Not to say that the tool couldn't be doing a better job.