![]() ![]() Quite practically, all the available action keywords are documented at the bottom of this window - so there’s no need to remember anything by heart! ![]() ![]() In our case, we want to reword the commit (which means we’d like to change the commit message, but leave the rest of the commit as is). We only mark up the respective line with an “action keyword”. Right after executing this command, your favorite editor will open up and present the list of commits you just selected (by providing a base commit).Īs a reminder: although you might be tempted to do so, we do not change the commit message here. Since we have to (at least) go back to the parent of our “bad apple” commit, we’re starting our session at HEAD~3 (three commits behind the HEAD commit, which is the one that’s titled “Change headlines …”): $ git rebase -i HEAD~3 Our first step is to determine the base commit for starting this interactive rebase session. ![]() You don’t need Tower to follow along in this tutorial.įor our example, let’s say that we’d like to edit the message of the commit currently titled “Optimize markup structure in index…” Note: For a better overview and clearer visualization, I’m using the Tower Git desktop client in some of my screenshots. Below is an image of a bad commit message that needs to be corrected. Let’s take a look at a concrete scenario. For any commit older than that, we have to use interactive rebase! You might be aware that git commit -amend also allows you to change a commit’s message - but only if it’s the very latest commit. One of the very popular use cases of interactive rebase is that you can edit an old commit message after the fact. With this theoretical overview out of the way, let’s dive into some practical cases together! I’ll demonstrate this point in practice shortly! Here, we are only going to tell Git what we want to do - but not make the actual change.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |