Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Created a named branch from the wrong parent

I am stuck in a scenario in which I have created a branch on Mercurial Workbench from a wrong parent branch. In other words I had to create a feature branch from parent : xxx and I have created it from parent : yyy.

Please note that I have also committed the changes, Is there any way I can either redirect my feature branch to xxx or I can delete the branch and re-create it with the same name (please note that having the same name is important) but this time I can create it from xxx.

I have exported the patches of my commits so after creating a branch even if my commits are lost I can import the patches again.

like image 777
Omar Bahir Avatar asked Oct 16 '22 10:10

Omar Bahir


1 Answers

If you needed to change the branch name you would want hg graft (see Graft vs. Transplant). But since you don't want to change the name, you only want to redo the base of the commits, you want hg rebase.

See Hg: How to do a rebase like git's rebase and also In Mercurial what's the difference between hg graft and hg rebase. Note that rebase is an extension, but is a bundled one: you merely need to enable it.

like image 127
torek Avatar answered Oct 20 '22 17:10

torek