处理重命名:svn vs. git vs. mercurial [英] Handling renames: svn vs. git vs. mercurial
本文介绍了处理重命名:svn vs. git vs. mercurial的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这些 VCS 如何处理重命名?
How do each of these VCS handle renames?
我发现了很多相互矛盾的信息,指出 git 跟踪 LOC(代码行)而不是文件,因此重命名对它没有意义.
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.
推荐答案
- Git 根本不跟踪重命名,而是使用启发式方法在合并等过程中重新发现它们.
- Mercurial 跟踪重命名(记录原始版本和原始文件)并在合并期间使用该信息.因此,您必须使用
hg mv
明确告诉 hg 有关重命名的信息,或者使用hg addremove --similarity
进行自动发现.也有一些关于在合并期间添加启发式方法的讨论. - Svn 轨道重命名,但我不知道它在合并期间处理它们的效果如何(从未实际测试过).
- 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 usehg 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).
这篇关于处理重命名:svn vs. git vs. mercurial的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文