We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Squash Series

Remember, the full workflow we're going for is this:

  1. Create a new branch off of main
  2. Go about your work on the feature branch making commits as you go.
  3. When you're ready to get your code into main, squash all your commits into a single commit.
  4. Push your branch to the remote repository.
  5. Open a pull request from the feature branch into main.
  6. Merge the pull request once it's approved.

Assignment

Let's tackle point 3.

We are rewriting the history of our own branch to make it look as if we did all the work in a single commit. This is "normal" and "fine" because it's just our own branch.

Run and submit the CLI tests.

Tip

To squash commits on the current branch:

git rebase -i HEAD~N

Where N is the number of commits you want to squash. Remember to change pick to squash for all but the first commit.