I have starting using Mercurial for my (our) versioning needs. I have now come to the point that I need to create a feature branch. However, now that I have started working on it -- and I try to push my changes, I keep getting a warning about new remote heads. That's stupid, I know that there will be new remote head(s) that's what a branch after all is?
How am I supposed to create branches and push them without this problem, without using force push as it is surely not the right way to go, right?
I thought about using separate repositories, but that feels just stupid especially for feature branches.
Any help welcome!
This tutorial by Joel Spolsky helped me a bunch when I just started out with mercurial. It might be helpful for you as well:
http://hginit.com/
To date, the best guide out there is Steve Losh's "A Guide to Branching in Mercurial".
Mercurial will always complain about creating new heads on the remote. You must use either
--force
or--new-branch
when creating a new head.When using TortoiseHg, the same can be accomplished via the
Synchronize
view of the Workbench. ClickOptions
and then select theAllow push of a new branch
orForce push or pull
option, as needed.The reason it behaves this is way is that the Mercurial developers wanted to make it a conscious decision to create a new head on the remote. Their view is that typical workflows should merge changes prior to pushing.