Question

I am using the TortoiseHG Workbench visual tool and doesn't have much experience with Revision Control.

The project currently have only one branch and I wanted to create another. I updated from an older revision, made a little alteration and I wanted to push it as a second branch. I clicked on the Synchronize button, then Options, and checked the option that permits that a new Named Branch be send (--new-branch).

However I still get the "push creates new remote head" error when pushing. What can I do so I can push a new branch?

Was it helpful?

Solution

You updated to an older revision and created a new head in the default branch, because you did not create a new named branch.

You need to create the new branch BEFORE you actually commit in your local repository. To do that, before clicking on the Commit button in TortoiseHg, click on the Branch: default button. You will be offered to Open a new named branch. Enter a new name, other than default

As soon as you commit, you will have a new head in you repository, but identified as a different branch. When pushing this changeset, you will not create a new remote head, but you will be pushing this new branch. If you do not set the option to allow a new branch to be pushed, TortoiseHg will kindly prompt you to validate your intent, and re-push it with the option enabled for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top