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.

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

-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^ 

2 Comments

Well, I am asking in mercurial... let me update the question to be more clear.
Thanks for the clarification, sorry I missed that.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.