

Commits are listed in reverse order! The newest commit, which we would expect to appear at the top, will appear at the bottom of the list.There are two important things to keep in mind in this step:
SOURCETREE INTERACTIVE REBASE NOT WORKING SERIES
Step 3: telling Git what you want to doĪfter starting the interactive rebase session, you’ll be presented with an editor window where Git lists a series of commits - from the latest commit, all the way to (but not including) the one you picked as a base commit in Step 1. Alternatively, I also could have provided a specific SHA-1 hash. In this example, I’ve used HEAD~3 to specify the commit that’s “3 behind the HEAD commit”. We’re using the git rebase command with the -i flag (to indicate we indeed want it to be “interactive”) and provide the base commit (that we came up with in our first step above). Starting the actual session is pretty simple: $ git rebase -i HEAD~3 In this example case, we would use C1 as the starting point for our interactive rebase session.

To be able to change the commit message in C2, we have to start our interactive rebase session at its parent commit (or even before that, if you want to). Our starting situation is pictured below, where we’re editing an old commit message via interactive rebase. Let’s make a practical example and say we’d like to edit an old commit message (which is what we’ll actually do in practice in a moment). The first question you need to answer is: “What part of my commit history do I want to manipulate?” This tells you where you should start your interactive rebase session. Step 1: Where should you start the session? Once you’ve firmly understood this basic mechanism, interactive rebase will lose its air of “complex mystery” and become a valuable, accessible item in your tool belt. The Basic Mechanism of an Interactive Rebase OperationĪlthough there are many different things that interactive rebase can be used for, the basic workflow is always the same.
