From 306d91cc62dca84970e391ff909e96672710cd75 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 13 May 2018 20:18:50 +0100 Subject: Fill out the section on interactive rebasing --- README.org | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.org b/README.org index 8b84361..396c3cb 100644 --- a/README.org +++ b/README.org @@ -209,6 +209,39 @@ now this is the only one needed. * Interactive rebasing +Interactive rebasing is very powerful, but can be quite tricky. Magit +can help with setting up an interactive rebase as well as providing +context and information while it's underway. + +** Preparation + +Enter some text in the following two example sections. Commit the +change to the first section in one commit, and then the second section +in a second commit. + +#+BEGIN_EXAMPLE + +#+END_EXAMPLE + +#+BEGIN_EXAMPLE + +#+END_EXAMPLE + +The interactive rebase we'll try will reverse the order of these +commits. + +** Starting the interactive rebase + +From the Magit status window, press =r= then =i= to select the +starting point for the interactive rebase. Move down (using =C-n=) to +the first of the commits you just created, and press =C-c C-c= to +start the interactive rebase. + +This will open a buffer for inputting the operations, you should see +the supported operations at the bottom of the buffer. In this case, +use the =M-n= and =M-p= to reverse the order of the commits. Press +=C-c C-c= to finish the interactive rebase. + * Splitting commits To split a commit, you can combine Magit's ability to revert portions -- cgit v1.2.3