处理重命名:svn与git与mercurial [英] Handling renames: svn vs. git vs. mercurial

查看:110
本文介绍了处理重命名:svn与git与mercurial的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我发现很多矛盾的信息,说明git跟踪LOC(代码行)而不是文件,重命名因此它没有任何意义。

解决方案


  • Git根本不会跟踪重命名,但使用启发式方法在合并期间重新发现它们。

  • Mercurial跟踪重命名(记录原始版本和原始文件)并在合并期间使用该信息。因此,您必须明确告诉hg有关 hg mv 的重命名,或者使用 hg addremove --similarity 进行自动发现。有一些关于在合并期间添加启发式的讨论。

  • Svn会跟踪重命名,但我不知道它在合并期间处理它们有多好(从未实际测试过) li>

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.

解决方案

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

这篇关于处理重命名:svn与git与mercurial的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆