Handling renames: svn vs. git vs. mercurial

前端 未结 6 967
忘了有多久
忘了有多久 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 15:53

    One more thing about git that hasn't been mentioned yet, in addition to using heuristics to determine whether a rename has happened:

    If a file or even an entire directory tree is renamed, copied, or moved, and nothing underneath is modified in any way, then the file or tree is actually stored as the same object inside the repository, and doesn't take up any extra space.

    If you modify it, then it's stored as a new object, as usual.

    I'm not sure about hg and svn, but I suspect their changelist-oriented architectures mean they behave differently in this scenario. It doesn't really have any effect on usage, except it might give you reason to avoid moving or copying huge trees inside your repository.

提交回复
热议问题