Generally speaking, making commits “bigger” (by combining multiple into one) is not a good strategy in most cases. Before we dive into how this works, let’s spend a few moments talking about when or why this could be valuable. Below is an image of a bad commit message that needs to be corrected.Īnother use case for interactive rebase is when you want to combine multiple separate commits into a single one. 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! Editing an Old Commit Message 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 |