Handling renames: svn vs. git vs. mercurial

git, mercurial, rename, svn, version-control

Solution

- Git doesn't track renames at all, but uses heuristic to re-discover them during merge etc.

- Mercurial tracks renames (the origin version and origin file is recorded) and uses that information during merges. So you have to explicitly tell hg about renames with `hg mv`, or use `hg addremove --similarity` for auto-discovery. There has been some talk about adding heuristics during merge too.

- Svn tracks renames, but I don't know how good it deals with them during merges (never actually tested that).

Problem

How do each of these VCS handle renames? I have found a lot of contradicting information stating that git tracks LOC (lines of code) instead of files, renames would therefore have no meaning for it.

Original source