git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Documentation: Transplanting branch with git-rebase --onto

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 6, 2006, 18:12 UTC
Message-ID
<200611061912.46436.jnareb@gmail.com>
In-Reply-To
<200611051122.17623.jnareb@gmail.com>

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@gmail.com>
---
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
Previous: Jakub NarebskiNext: Junio C Hamano
Message 4 of 8 in “Documentation: Two more git-rebase --onto examples”
  1. Documentation: Two more git-rebase --onto examplesJakub Narebski, Nov 4, 2006
  2. Junio C HamanoNov 5, 2006
  3. Jakub NarebskiNov 5, 2006
  4. Documentation: Transplanting branch with git-rebase --ontoJakub Narebski, Nov 6, 2006
  5. Junio C HamanoNov 6, 2006
  6. Jakub NarebskiNov 6, 2006
  7. Carl WorthNov 6, 2006
  8. Junio C HamanoNov 6, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.