简体   繁体   English

合并后推送到远程存储库“创建新的远程磁头” - 是不是很糟糕?

[英]Pushing to remote repository after merge “creates new remote heads” - is that bad?

  1. I initialized a Mercurial project on Machine A , committed my changes and uploaded them to a remote repository. 我在Machine Ainitialized了一个Mercurial项目, committed我的更改并将它们uploaded到远程存储库。

  2. Then I cloned that repository on Machine B , committed some additional changes and uploaded them to the same remote repository. 然后我clonedMachine B上的存储库, committed一些额外的更改并将它们uploaded到同一个远程存储库。

In both cases, I uploaded the changes with the same command: 在这两种情况下,我都使用相同的命令上传了更改:

hg push https://username:password@domain/user/repository/

Now I'm back on Machine A and I've pull ed from the remote repository and merg ed any changes between the two changesets using the KDiff3 GUI tool using the commands: 现在我回来了计算机A上,我已经pull从远程仓库ED和merg编使用两个变更集之间的任何变化KDiff3使用命令GUI工具:

hg pull
hg merge
hg commit

However, when I try to push the latest changes from Machine A back to the remote repository after this pull and merge, I get this message: 但是,当我尝试在此拉取和合并之后将最新的更改从机器A推回到远程存储库时,我收到以下消息:

hg push https://username:password@domain/user/repository/
pushing to https://username:password@domain/user/repository/
searching for changes
abort: push creates new remote heads!
(did you forget to merge? use push -f to force)

Why does it say "did you forget to merge"? 为什么会说“你忘了合并”? -- I completed the merge. - 我完成了合并。

Is it bad to force the push and create "new remote heads"? 强迫推动并创造“新的遥控头”是不是很糟糕?

If so, how do I avoid this? 如果是这样,我该如何避免这种情况?


UPDATE: 更新:

I ran " hg merge " again and got this output: 我再次运行“ hg merge ”并获得此输出:

5 files updated, 1 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon

So I ran ' hg up --clean ' and it reported: 所以我跑了' hg up --clean ',它报告说:

6 files updated, 0 files merged, 1 files removed, 0 files unresolved

Now when I type ' hg heads ', it says: 现在当我输入' hg heads '时,它说:

changeset:   11
tag:         tip
parent:      9
user:        eggdrop
date:        Tue Oct 20 16:27:44 2009 -0400
summary:     Machine A after merge

changeset:   10
parent:      7
user:        chickensoup
date:        Thu Oct 15 03:27:23 2009 -0400
summary:     Machine B changes to be pulled onto Machine A

You ran hg up --clean . 你跑了hg up --clean That means you undid the merge, which means you still need to merge. 这意味着你取消了合并,这意味着你仍然需要合并。 You have an unresolved file when you merge. 合并时有一个未解析的文件。 Re-read your error message: 重新阅读您的错误消息:

5 files updated, 1 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon

You need to resolve the merge conflict and then complete the merge with hg resolve . 您需要解决合并冲突,然后使用hg resolve完成合并。 Then you will have successfully merged your two heads. 然后你将成功合并你的两个脑袋。

And to answer your question: no, it's not bad to have two remote heads. 并回答你的问题:不,有两个遥控头也不错 It just means you need to merge them (preferably ASAP) before you push anything else to the remote server. 它只是意味着您需要在将任何其他内容推送到远程服务器之前将它们合并(最好是ASAP)。

So to fix, just run hg merge , resolve the one conflict, then run hg resolve . 所以要修复,只需运行hg merge ,解决一个冲突,然后运行hg resolve

First: View your changes with hg log . 第一:使用hg log查看您的更改。 The following didn't help in my case: 以下对我的案例没有帮助:

  • hg pull and hg merge (before you pull check against hg incoming) hg pullhg merge (在你检查hg传入之前)
  • or: hg pull --rebase 或者: hg pull --rebase

But this helped. 但这有帮助。

hg merge [revision]

I found that I needed to explicitly merge some revisions which looked like heads. 我发现我需要明确合并一些看起来像头的修订版。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 推创建新的远程头! (您是否忘记合并?使用push -f强制) - Push creates new remote heads! (did you forget to merge? use push -f to force) 如何在mercurial中撤消“abort:push在分支上创建新的远程头” - How to undo “abort: push creates new remote heads on branch” in mercurial 合并后,Mercurial Push创建新的远程头部 - Mercurial push creates new remote head after a merge 在远程存储库中创建多个头 - Creating multiple heads in remote repository 从teamcity标记商品修订失败,并带有“在分支'default'上推动创建新的远程头像” - Labelling mercurial revision from teamcity fails with “push creates new remote heads on branch 'default'” 拉并合并具有多个头的远程分支更改 - Pull and merge remote branch changes with multiple heads TortoiseHg-如何在推送到远程存储库后从分支中删除文件 - TortoiseHg - How to remove files from a branch after pushing to remote repository Mercurial和TortoiseHG - 推送更改后更新远程存储库 - Mercurial and TortoiseHG - Update remote repository after pushing changes Mercurial合并分支机构? (abort:push创建新的远程分支) - Mercurial merge branches? (abort: push creates new remote branches) Mercurial分支修订历史,推动时两个偏头 - Mercurial branched revision history, two remote heads when pushing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM