为什么我不能将此更改推送到我的“主要”应用程序?水银存储库?
我正在尝试理解 Mercurial,希望我只是在这里感到困惑!
我有一个存储库('main'),我已经克隆('clone'),两者都在我自己的机器上。两者完全同步。
我决定使用命名分支,因此下次我提交“克隆”时,我在分支名称“case1212”下进行了操作,虽然它似乎已正确处理了我的克隆上的提交,但我无法将这些更改推回原处到“主要”。给出的错误是:
abort: push creates new remote branch 'case1212'!
...这表明我可能需要先合并?我应该在那个“克隆”存储库上合并什么?当我尝试从“main”中提取时,没有任何变化。
我很确定我实际上希望它在我的“主”存储库中创建一个远程分支,以便从它更新的人可以看到该分支。
I am trying to grok Mercurial and hope I am just getting confused here!
I have a repository ('main') that I have cloned ('clone'), , both on my own machine. Both were completely in sync with each other.
I decided to play with named branches so the next time I committed on my 'clone' I did it under a branch name of 'case1212' and while it seems to have dealt with the commit properly on my clone, I cannot push these changes back to 'main'. The error given is:
abort: push creates new remote branch 'case1212'!
...and it suggests that I might need to merge first? What am I supposed to merge on that 'clone' repository? When I try to pull from 'main', there are no changes.
I'm pretty sure I actually would want it to create a remote branch in my 'main' repository so people who update from it can see that branch.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Mercurial 的默认行为会阻止您创建远程分支。如果你想做到这一点,你需要用力推动。
您显示的窗口中的同步菜单,有一个强制推送的选项。
Mercurial's default behavior prevents you from creating remote branches. If you want to do this, you need to force-push.
Synchronize menu in the window you show, there is an option for force push.
Tortoise 现在有一个选项
推送新分支
,它可能比强制拉或推
更安全。命令行工具有一个标志 --new-branch。更新:新的乌龟界面使其更难找到。切换到同步视图,然后单击选项并选择允许推送新分支。
Tortoise now has an option
Push new branch
that may be safer thanForce pull or push
. The command line tool has a flag --new-branch.Update: The new tortoise interface makes it a bit harder to find. Switch to the Synchronise view, then click options and select allow push of a new branch.
它警告您,您的推送将创建新的远程头(在本例中为分支)。如果您对此表示同意(听起来您也同意),则可以使用
push -f
进行推送。此检查就在那里,因此如果您希望 case1212 分支不返回主服务器,您可以执行
hg Push -r default
然后您就不会看到此警告,也不会发送 case1212。一旦您对 case1212 执行此操作,您将不会再看到警告,因为 case1212 已经存在。
在新头是新分支的情况下,较新版本的 Mercurial 使得该警告听起来不那么可怕。
It's warning you that your push would create new remote heads (and in this case branches). If you're okay with that, and it sounds like you are, you can push with
push -f
.This check is in there so that if you wanted that case1212 branch to not go back to the main server you could do
hg push -r default
and then you'd not see this warning and not send case1212.Once you've done this for case1212 you won't see the warning again since case1212 will already be there.
Newer versions of mercurial make that warning a little less scary sounding in the case where the new head is a new branch.