Johannes Rudolph Johannes Rudolph - 3 years ago 307
Git Question

Handling renames: svn vs. git vs. mercurial

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.

Answer Source
  • 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).
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download