Mercurial - 我的提交是如何被拆分的(见图)?
自己分开的线是怎么回事?我做了一次提交,然后对存储库进行了拉取,然后进行了更新。
是什么原因造成的呢?
如何将分割的部分放回到主线中?
What's going on with the line that split out on it's own? I did a commit and then I did a pull for the repository and then an update.
What caused this?
How do I get that split part back into the main line?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Michal 有你的“如何修复”——选择他的答案——但这就是发生这种情况的原因:在提交之前你还没有更新到提示修订版。如果您执行
hg pull
,您当前的修订版本(由hg 父母
报告)不会更新为tip
。您需要hg update Tip
或pull -u
来实现这一点。新提交始终具有当前hgparents
输出的父版本,不一定是tip
。Michal has your "how to fix" -- pick his answer --, but here's why it happened: Before committing you had not updated to the tip revision. If you do a
hg pull
your current-revision (as reported byhg parents
) isn't updated totip
. You need tohg update tip
orpull -u
to make that happen. New commits always have a parent revision of your currenthg parents
output, not necessarilytip
.分裂是一个新的分支。如果您愿意,您可以将其合并回主干,但要小心代码。要进行合并,请选择新分支的尖端,打开上下文菜单,然后选择合并。它将与当前标记为
tip
的任何 Rev 合并。The split is a new branch. You can merge it back to the trunk if you like, though beware of borked code. To do the merge, select the tip of the new branch, bring up the context menu, and select Merge With. It will merge with whatever Rev is currently tagged as
tip
.