git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] Documentation: Two more git-rebase --onto examples
@ 2006-11-04 21:05 Jakub Narebski
  2006-11-05  1:08 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Jakub Narebski @ 2006-11-04 21:05 UTC (permalink / raw)
  To: git

Added example of transplantig feature branch from one development
branch (for example "next") into the other development branch (for
example "master").

Added example of rebasing part of branch, or transplanting feature
branch from the tip of other feature branch to the development branch
the second feature branch started from.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
I asked for comments because I'm not native English speaker and I'm not
sure about correctness of descriptions of added examples.

P.S. Perhaps we should separate the part dealing with CONFLICT(contents)
into separate documentation file, and include it as needed (for example
alsop in git-push(1)).

 Documentation/git-rebase.txt |   55 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 10f2924..1308d2f 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -65,6 +65,61 @@ would be:
     D---E---F---G master
 ------------
 
+More useful example of --onto option usage include transplanting feature
+branch from one development branch to other, for example change to branch
+based off "next" branch:
+
+------------
+    o---o---o---o---o  master
+         \
+          o---o---o---o---o  next
+                           \
+                            o---o---o  topic
+------------
+
+to being a branch based off "master" branch as shown below:
+
+------------
+    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
+
+
+Yet another example of use for --onto option is to rebase part of
+branch. If we have the following situation:
+
+------------
+                            H---I---J topicB
+                           /
+                  E---F---G  topicA
+                 /
+    A---B---C---D  master
+------------
+
+then the command
+
+    git-rebase --onto master topicA topicB
+
+would give us the following situation:
+
+------------
+                 H'--I'--J'  topicB
+                /
+                | E---F---G  topicA
+                |/
+    A---B---C---D  master
+------------
+
+with "topicB" branch based off "master".
+
+
 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.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-11-06 23:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-04 21:05 [PATCH/RFC] Documentation: Two more git-rebase --onto examples Jakub Narebski
2006-11-05  1:08 ` Junio C Hamano
2006-11-05 10:22   ` Jakub Narebski
2006-11-06 18:12     ` [PATCH] Documentation: Transplanting branch with git-rebase --onto Jakub Narebski
2006-11-06 22:53       ` Junio C Hamano
2006-11-06 23:14         ` Jakub Narebski
2006-11-06 18:14     ` [PATCH/RFC] Documentation: Two more git-rebase --onto examples Carl Worth
2006-11-06 19:18       ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).