Mercurial中的分支机构和远程负责人 [英] Branching and remote heads in Mercurial

查看:56
本文介绍了Mercurial中的分支机构和远程负责人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下命令创建了一个新分支:

hg branch new_branch

第一次提交新分支后,默认分支变为非活动状态.如果按下此按钮,则中央存储库将只有一个属于新分支的头.

当我的同事将其提交推送到默认分支时,他会收到此错误:

pushing to ssh://...
searching for changes
abort: push creates new remote heads!
(did you forget to merge? use push -f to force)

强制执行是否有任何不好的事情?为什么远程磁头不好?

您如何在单独的分支机构上远程工作并推送到一个存储库?

解决方案

远程头很糟糕,因为您基本上是在努力与他人合并.出现此消息是为了防止人们意外引入远程头,告诉他们在推动之前先合并.

在这种情况下,您已经创建了一个命名分支,这意味着您有意引入并共享一个新的标题,并且可以将警告作为参考信息而丢弃.使用hg push --new-branch强制执行此操作(或在版本1.6之前的-f进行强制执行).

I created a new branch using this command:

hg branch new_branch

After the first commit to the new branch, the default branch becomes inactive. If this is pushed the central repository will have only one head which belongs to the new branch.

When my colleague pushes his commits on the default branch, he will get this error:

pushing to ssh://...
searching for changes
abort: push creates new remote heads!
(did you forget to merge? use push -f to force)

Is there anything bad about forcing the push? Why are remote heads bad?

How do you work remotely on separate branches and push to one repository?

解决方案

Remote heads are bad because you’re basically pushing the effort of merging onto another person. This message is there to prevent people from accidentally introducing remote heads, telling them to merge first before pushing.

In this case though, you have created a named branch, meaning you intentionally introduce and share a new head, and you can discard the warning as informational. Use hg push --new-branch to force it (or -f before version 1.6).

这篇关于Mercurial中的分支机构和远程负责人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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