在Mercurial分支 [英] Branching in Mercurial

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

问题描述

我已经开始使用Mercurial来满足(我们的)版本控制需求.现在,我需要创建一个功能分支.但是,既然我已经开始着手研究了,并且我尝试推动更改,那么我会不断收到有关新的远程磁头的警告.那太愚蠢了,我知道会有一个新的远程头到底是个分支吗?

I have starting using Mercurial for my (our) versioning needs. I have now come to the point that I need to create a feature branch. However, now that I have started working on it -- and I try to push my changes, I keep getting a warning about new remote heads. That's stupid, I know that there will be new remote head(s) that's what a branch after all is?

我应该如何创建分支并在没有此问题的情况下推送它们,而不使用强制推送,因为这肯定不是正确的方法,对吗?

How am I supposed to create branches and push them without this problem, without using force push as it is surely not the right way to go, right?

我曾考虑过使用单独的存储库,但是感觉特别愚蠢,特别是对于功能分支.

I thought about using separate repositories, but that feels just stupid especially for feature branches.

欢迎您的帮助!

推荐答案

迄今为止,最好的指南是史蒂夫·洛什(Steve Losh)的"

To date, the best guide out there is Steve Losh's "A Guide to Branching in Mercurial".

Mercurial总是会抱怨在遥控器上创建新的磁头.创建新磁头时,必须使用--force--new-branch.

Mercurial will always complain about creating new heads on the remote. You must use either --force or --new-branch when creating a new head.

使用TortoiseHg时,可以通过Workbench的Synchronize视图完成相同的操作.单击Options,然后根据需要选择Allow push of a new branchForce push or pull选项.

When using TortoiseHg, the same can be accomplished via the Synchronize view of the Workbench. Click Options and then select the Allow push of a new branch or Force push or pull option, as needed.

之所以如此行事,是因为Mercurial开发人员希望做出一个明智的决定,以便在遥控器上创建一个新的机头.他们认为典型的工作流程应在推送之前合并更改.

The reason it behaves this is way is that the Mercurial developers wanted to make it a conscious decision to create a new head on the remote. Their view is that typical workflows should merge changes prior to pushing.

这篇关于在Mercurial分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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