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

后端 未结 2 452
长发绾君心
长发绾君心 2021-02-05 13:22
  1. I initialized a Mercurial project on Machine A, committed my changes and uploaded them to a remote

相关标签:
2条回答
  • 2021-02-05 13:30

    You ran 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. 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.

    So to fix, just run hg merge, resolve the one conflict, then run hg resolve.

    0 讨论(0)
  • 2021-02-05 13:30

    First: View your changes with hg log. The following didn't help in my case:

    • hg pull and hg merge (before you pull check against hg incoming)
    • or: hg pull --rebase

    But this helped.

    hg merge [revision]
    

    I found that I needed to explicitly merge some revisions which looked like heads.

    0 讨论(0)
提交回复
热议问题