Anna
Anna

Reputation: 553

How should `hg rebase` be used?

I have two branches default and bug, I want to rebase bug branch with last commit from default branch. I've tried:

hg phase --draft --force -r bug
hg rebase -d default

Result: I have default branch with my commits from bug branch. Which is not exactly what I want, so now I have two issues:

  1. How can I cancel rebase and checkout my default branch equal to repository?
  2. How should I work with hg rebase that it change the bug branch, not default?

Upvotes: 3

Views: 1761

Answers (1)

Mark Tolonen
Mark Tolonen

Reputation: 177901

  1. When you rebased incorrectly, Mercurial normally saves a backup in .hg\strip-backup. Restore that backup with hg pull <path_to_backup>. Then, hg strip -r <incorrect_rebased_rev>. That should put you back where you started.

  2. hg rebase -r default -d bug will move the latest default changeset to the tip of bug.

Upvotes: 3

Related Questions