Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Ignacio Mattos <[email protected]>
  • Loading branch information
navarroaxel and nachoSource authored Sep 27, 2024
1 parent 37361ea commit da10fb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions posts/navarroaxel/20.git-rebase-edit.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ id: 2015782

In the previous posts we checked how to use the [`git rebase --interactive`](https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---interactive) and how to squash your commits using the `fixup` command in the `git-rebase-todo` file.

Now, we're going to learn how to split commits using the terminal. But why split a commit? This helps organize your work. For instance, you may need to rearrange your changes to make backporting hotfixes to older released versions easier, likely using `git cherry-pick`. Let’s dive in!
Now, we're going to learn how to split commits using the terminal. But why splitting a commit? This helps to organize your work. For instance, you may need to rearrange your changes to make backporting hotfixes to older released versions easier, likely using `git cherry-pick`. Let’s dive in!

## Splitting commits

Expand All @@ -25,7 +25,7 @@ break

💡 You can `pick` the rebased commits in any order! but this can cause Git conflicts 😞. Also you can `pick` commits from other branches like [`git cherry-pick`](https://git-scm.com/docs/git-cherry-pick).

Well, Git will `pick` the commit `0680aa7` as-is and run `npm test` and if the command exists successfully then Git will pick the commit `68ab202` and break returning the control of the shell to you allowing to `edit` this last commit. Let's see how to edit the last commit.
Well, Git will `pick` the commit `0680aa7` as-is and run `npm test` and if the command exists then Git will pick the commit `68ab202` and break, returning the control of the shell to you allowing to `edit` this last commit. Let's see how to edit the last commit.

🧠 To clarify: `edit` stops after applying the commit, so that you can edit the files or the commit message, amend the commit, and continue rebasing.

Expand All @@ -45,7 +45,7 @@ git commit -m 'fix grid responsiveness'
git rebase --continue
```

Git will continue running the second `exec` command that makes an `npm test`, if this fails you need to fix your code, otherwise Git will continue with the `break` command returning the control of the shell to you again. Here you are able to run your application, make the final checks, etc.
Git will continue running the second `exec` command that makes an `npm test`. If this fails you will need to fix your code; otherwise Git will continue with the `break` command returning the control of the shell to you again. Here you are able to run your application, make the final checks, etc.

If you're happy with the changes, run `git rebase --continue` to finish the rebase, or `git rebase --abort` to cancel all changes. 👀

Expand Down

0 comments on commit da10fb7

Please sign in to comment.