When I rename a file, git thinks that I've deleted the file and created another file. How can I rename a file, so that git knows I'm "renaming" it?
Asked
Active
Viewed 484 times
3 Answers
4
git mv
is just a convinience command as mentioned in git wiki
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.
This answer also tells about the same and some other use cases.
2
In contrast to traditional SCMs, git track content instead of files,
more detailed description here: https://git.wiki.kernel.org/index.php/Git_FAQ#Why_does_Git_not_.22track.22_renames.3F

miushock
- 1,087
- 7
- 19
-
1This answer isn't really all that clear, it would be better if it had more explanation of how this relates to how Git knows that you've renamed a file. – Mar 08 '14 at 22:41