You heard the truth, sort of.
Git works with the contents of the files, not the files themselves, so renaming is technically pointless for him. In git, renaming looks like file A disappeared, and file B appeared with the same contents as A. But git is actually very well-understood when the file was really renamed.
Try it: rename the file, then run 'git rm oldname' and 'git add newname' to tell git to make changes, then run 'git status' to see what git thinks it does - you will see that it tells you that the file has been renamed. However, I’m not sure if this means anything else. Look at the commit with 'git show' and you will not see any mention of renaming, just a bunch of lines removed from one path and added to another.
Alternatively, you can also use the git mv 'command to rename the file. It does not change how git sees the operation, it just efficiently executes “mv oldname newname”, “git rm oldname” and “git add new name” in one step.
For a Mercurial review, see tonfa answer .
SVN, on the other hand, cannot detect renames, but must report them using the svn mv command. However, when said, it tracks the rename as "first class," so when you look at the list of changes, you will see that the change was a rename.
I would not suggest choosing SVN over git or mercury based on this function. Significantly large and important differences between tools. I would first decide if you want a distributed version control system (git or mercurial) or a centralized version control system (svn).
divegeek Oct 08 '09 at 13:20 2009-10-08 13:20
source share