diff options
-rw-r--r-- | README.org | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -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 |