Added example of transplantig feature branch from one development branch (for example "next") into the other development branch (for example "master"). [jn: with a little help from Junio] Signed-off-by: Jakub Narebski <jnareb@xxxxxxxxx> --- What about this? The second example I think has place in tutorial or GitTips on GitWiki Documentation/git-rebase.txt | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 10f2924..9e822c5 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -65,6 +65,40 @@ would be: D---E---F---G master ------------ + +Here is how you would transplant a topic branch based on one +branch to another, to pretend that you forked the topic branch +from the latter branch, using `rebase --onto`. + +First let's assume your 'topic' is based on branch 'next'. +For example feature developed in 'topic' depends on some +functionality which is found in 'next'. + +------------ + o---o---o---o---o master + \ + o---o---o---o---o next + \ + o---o---o topic +------------ + +We would want to make 'topic' forked from branch 'master', +for example because the functionality 'topic' branch depend on +got merged into more stable 'master' branch, like this: + +------------ + o---o---o---o---o master + | \ + | o'--o'--o' topic + \ + o---o---o---o---o next +------------ + +We can get this using the following command: + + git-rebase --onto master next topic + + In case of conflict, git-rebase will stop at the first problematic commit and leave conflict markers in the tree. You can use git diff to locate the markers (<<<<<<) and make edits to resolve the conflict. For each -- 1.4.3.4 - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html