问题描述
我在Bitbucket上有一个Mercurial仓库,在我的本地计算机上,它们都是最新的镜像.我创建了一个功能分支,反映在两个存储库中.我在功能分支中完成了所有工作.
I have a Mercurial repo at Bitbucket and on my local machine, both are mirrors, up to date. I created a feature branch, reflected in both repos. I did all my work in the feature branch.
功能分支现已完成,我现在要将其设置为主仓库和本地副本的默认值.我不太在乎默认分支,功能分支已经做了足够的工作,我要做的就是将其指定为新的默认分支.
The feature branch is now complete and I want to now make it the default for the main repo and my local copy. I don't really care about the default branch, enough work has gone into the feature branch that all I want to do is designate it as the new default.
我不希望合并,也可以吗?我该怎么做,以免使本地和远程都感到困惑?
I don't think I want to merge nor should I? How can I do this so both local and remote don't get confused?
推荐答案
只需将feature-branch
合并到default
中,然后关闭feature-branch
:
Just merge feature-branch
into default
then close feature-branch
:
$ hg checkout default
$ hg merge feature-branch
$ hg commit
$ hg checkout feature-branch
$ hg commit --close-branch
没有(我知道)更干净,更明智的方式将feature-branch
设置为默认值".
There is no more clean and sensible way (that I'm aware of) to "make feature-branch
the default".
一件不太好的事情,但是您可以做的是,在feature-branch
之上提交对default
的提交:
One thing that wouldn't be as nice, but you could do, is to make a commit to default
on top of feature-branch
:
$ hg checkout feature-branch
$ hg branch default
$ hg commit
但是这会在default
分支中留下两个头,这是次优的.
But this would leave two heads in the default
branch, which is suboptimal.
这篇关于将其他分支设为默认值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!