0

I have edited some files in the repo and now it looks like the following:

history1 --> history2 --> ... --> master
                \
                 \
                  my commit 1 --> my commit 2

But actually 'my commit 2' should not be on top of 'my commit 1', that's a mistake... How do I only rebase 'my commit 2' to master in mercury?

history1 --> history2 --> ... --> master
                \                   \
                 \                   \
                  my commit 1        my commit 2

I am asking how to do this in Mercurial not git.

WhatABeautifulWorld
  • 3,198
  • 3
  • 22
  • 30

2 Answers2

1

Make sure you have the rebase extension enabled in your hgrc file. Then:

$ hg rebase -r <commit ID of my commit 2> -d master

See "hg help rebase" for more details.

ngoldbaum
  • 5,430
  • 3
  • 28
  • 35
-1

From a different post:

You can cherry-pick XX to master.

git checkout master
git cherry-pick <commit ID of XX>

And remove the last commit from the feature branch with git reset.

git checkout Feature-branch
git reset --hard HEAD^
Frood
  • 1
  • 2