Mercurial - close default branch and replace with a named branch as new default

前端 未结 3 1652
暗喜
暗喜 2021-01-31 20:11

In a mercurial repo, the \"default\" branch has fallen very out of date to the point where it no longer makes sense to merge in the changes from \"develop\", a named branch whic

3条回答
  •  广开言路
    2021-01-31 20:57

    If default has diverged somewhat from develop and you want default to be exactly the same as develop after the merge, you need a slightly different set of commands from what Edward gave you (this will also work where develop is a direct descendant of default).

    hg update -C default
    hg -y merge --tool internal:fail develop
    hg revert --all --no-backup -r develop
    hg resolve --all --mark
    hg commit -m "merge updating default to current develop"
    

    This means that any conflicts will result in an unresolved merge. You then revert everything to be the same as on the develop branch (with no backup so you don't get lots of .orig files left over).

提交回复
热议问题