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?
3 Answers
To rename a file with git use git mv
git mv oldname newname 1 Comment
miushock
Down voting for potentially miss leading
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.
Comments
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