Search code examples
version-controlmercurialtortoisehg

"push creates new remote head" issue


I read all SO questions about this issue, and I still can't resolve it.

I am using TortoiseHg. I worked on a side-branch, and now I want to merge it back to the main branch. I pulled all changes made in both branches, updated to the main branch, and merged (and committed). But still when I try to push all this, I get the "abort:push creates new remote head" message.

I also tried (as was suggested in one of the questions in SO) to close the branch using the --close-branch option.

The only thing I did not try is to 'force' push. Any suggestions? Or is force-pushing the only option?

See screenshot


Solution

  • I just tried a similar setup, and I get the same warning. Apparently, although the second head you are trying to push is closed, it is seen as another head during the push. And closing both heads does not seem to be pushable either.

    You can force the push, it should be ok, but you could eventually get the same issue if you keep multiple heads on your visualization branch, like you already have with changesets 14 and 20. To solve the issue once and for all, I would instead suggest to merge both changesets (14 and 20) and reclose the final head.