Handling renames: svn vs. git vs. mercurial

前端 未结 6 956
忘了有多久
忘了有多久 2020-12-02 15:42

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

6条回答
  •  执笔经年
    2020-12-02 16:12

    • 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).

提交回复
热议问题