Search code examples
mercurialtortoisehg

How to rebase in tortoisehg?


Often after committing changes, I do a pull, before pushing my changes, and someone has already committed changes. I could do another (merge) commit, but where possible I like to maintain linear history, as it makes things a bit easier to read.

So how does one rebase a changeset using tortoisehg, without resorting to using the command line?


Solution

  • First enable rebase:

    File -> Settings -> Extensions

    enter image description here

    Then (after restarting tortoisehg)

    1. Update to the changeset you want to rebase on to.

    updating to base changeset

    1. Right click on change you want to rebase and select the Modify History -> Rebase menu.

    clicking rebase

    1. Click Rebase.

    And you should end up with something like this:

    enter image description here

    Warnings:

    1. It's not usually a good idea to rebase a changeset with a public Phase.
    2. Avoid rebasing changes that are likely to produce complicated merge conflicts.