Reputation: 21
Hi im a bit of a newbie on tortoise hg. I made some changes to the code (revision 100 and 101) and realised I dont need them. I therefore "updated" (right click update) to 99 then continued developing. Now I try to commit to the server using the push button and I get the error:
abort: push creates new remote head 66444791e8ed on branch 'Marc-dev'! hint: merge or see 'hg help push' for details about pushing new heads
How do I solve this? Please make it as easy as possible for me as I dont have a tonne of experience.
thanks
Upvotes: 0
Views: 347
Reputation: 1788
If you don't need the two changesets 100 and 101 and want to get rid of them, you can delete (strip) them from the history. First ensure that the strip extension is activated (File > Settings > Extensions). Now right-click on changeset 100 and select Modify History > Strip from the context menu. The function removes the selected changeset and its children. You can also do this from the terminal with hg strip 100
.
With the second head removed, you should now be able to push your changes.
Edit: I just noticed that you probably already pushed the changesets 100/101 to the remote server. In this case you can't simply delete them. Instead, you could backout the redundant changes and rebase your latest changes on top of the initial branch:
It's easier to do this from the command-line:
hg up 101
hg backout 101
hg backout 100
hg rebase -s 102 -d 105
The backout
commands creates two additional changesets, probably 104 and 105. rebase
moves your two new changesets 102/103 on top of 105. Now you should be able to push.
Upvotes: 0