From d45a8b42ca8c8d1c32ea0c353ff672a60f061b67 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 13 May 2018 20:01:30 +0100 Subject: Add headings to break up the Splitting section --- README.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.org b/README.org index ed94db7..8b84361 100644 --- a/README.org +++ b/README.org @@ -214,6 +214,8 @@ now this is the only one needed. To split a commit, you can combine Magit's ability to revert portions of a commit with an interactive rebase. +** Preparation + First, lets create a single commit to split. Add some text to both of the following example blocks. @@ -227,6 +229,8 @@ the following example blocks. Then commit the additions as a single commit. +** Starting the interactive rebase + As the commit needing splitting is the most recent, it's not necessary to rebase to edit the right commit, however, in general, you may need to interactively rebase, and choose to edit the commit you intend to @@ -238,6 +242,8 @@ edit the most recent commit. Once you've begun the rebase, in the status window, select the commit to split and press =RET= (Enter) to show the full details. +** The actual splitting + To split the contents of the commit, we are going to remove some parts from it. To do that, we can revert those parts, stage that change, then revert the staged changes. Once the staged changes have been @@ -261,6 +267,8 @@ done, stage the unstaged changes, and commit them. When you're finished committing the unstaged changes, continue the rebase to finish. +** Splitting one commit in to more than two commits + If you wish to split one commit in to more than two commits, then you can repeat the above process again once finished, or revert all the parts you wish to split out, and then stage and commit the appropriate -- cgit v1.2.3