

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Squashing
incomplete
2: How to Squash
incomplete
3: Overwrite
incomplete
4: Force Push
incomplete
5: Squashing Is Scary
incomplete
6: Squashing PRs
incomplete
7: Squash Series
incomplete
8: Pull Request
incomplete
9: Merge the Pull Request
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Remember, the full workflow we're going for is this:
Create a new branch off of main
Go about your work on the feature branch making commits as you go.
When you're ready to get your code into main, squash all your commits into a single commit.
Push your branch to the remote repository.
Open a pull request from the feature branch into main.
Merge the pull request once it's approved.
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.
To squash commits on the current branch:
git rebase -i HEAD~NWhere N is the number of commits you want to squash. Remember to change pick to squash for all but the first commit.