使用新的"hg rebase"后,您的经验是什么?命令? [英] What are your experiences using the new "hg rebase" command?

查看:162
本文介绍了使用新的"hg rebase"后,您的经验是什么?命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,汞变基"对您有何影响?您发现任何错误或陷阱了吗?在什么情况下会代替或补充mq?

How has "hg rebase" treated you so far? Have you discovered any bugs or gotchas? In what situations does it replace or complement mq?

推荐答案

在简单的情况下(没有或只有很少的合并冲突),Rebase非常好,但是如果有很多冲突,那么这样做就更麻烦了,与常规的merge + commit相比:

Rebase is very nice in the simple case (no or few merge conflicts), but if you have a lot of them it can be more trouble that it's worth, compared to the regular merge+commit:

Rebase更改您的提交&更改历史记录,并且默认情况下会删除您的原始提交.如果他们在糟糕的时刻撞到你,这会带来很多麻烦:

Rebase changes your commits & alters history, and by default removes your original commits. This has a number of implications which are quite hairy if they hit you in a bad moment:

  • 无法查看如何解决冲突. (即原始提交和重新设置之间的区别,除非您选择保留它们并在推送之前手动剥离它们)
  • 无法测试合并的每个重新创建的修订版本,可以在提交它们之前对其进行编译和运行.您重新设定基准,提交更改. (与上述相同)
  • 如果您确实在进行分布式工作并从许多来源进行共享/拉动,则必须格外小心,不要共享您打算作为基准的任何提交.
  • 此外,如果在上述情况下,您意外地重新设置了基准,然后又从某人处拉回了这些预重新基准提交,则您会得到双重提交,并且需要将它们中的一组"剥离". (我没有试图在这里合并.)

问题在于,重新设置基准会编辑历史记录. SVN在更新"上执行的操作.因此,绝对可以使用它,但是如果您有很多未完成的提交并且预计会有很多冲突,那么我建议您使用合并.

The problem is that rebase edits history. Which is what SVN does on 'update'. So, it's definitely something you could use, but if you have many outstanding commits and expect many conflicts, I recommend a merge instead.

这篇关于使用新的"hg rebase"后,您的经验是什么?命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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