Recall & Review
beginner
What is the purpose of
git rebase -i?It allows you to edit, reorder, squash, or remove commits in a branch history before sharing it.
Click to reveal answer
beginner
In an interactive rebase, what does the command
pick mean?It means to keep the commit as is during the rebase process.
Click to reveal answer
intermediate
What does the
squash command do in git rebase -i?It combines the current commit with the previous one, merging their changes and messages.
Click to reveal answer
beginner
How do you start an interactive rebase to edit the last 3 commits?
Run
git rebase -i HEAD~3 to open the last 3 commits for editing.Click to reveal answer
intermediate
What happens if you reorder commits in the interactive rebase editor?
Git will replay the commits in the new order, changing the commit history accordingly.
Click to reveal answer
What does
git rebase -i HEAD~4 do?✗ Incorrect
The command opens the last 4 commits in an editor for interactive rebase.
Which command in the interactive rebase editor combines commits?
✗ Incorrect
The 'squash' command merges a commit into the previous one.
If you want to completely remove a commit during interactive rebase, which command do you use?
✗ Incorrect
The 'drop' command removes the commit from history.
What does the
edit command do in an interactive rebase?✗ Incorrect
The 'edit' command pauses the rebase so you can change the commit.
After finishing an interactive rebase, what should you do if you already pushed the original commits?
✗ Incorrect
You need to force push to update the remote branch with rewritten history.
Explain how to use
git rebase -i to combine two commits into one.Think about opening commits for editing and merging them.
You got /4 concepts.
Describe what happens when you reorder commits during an interactive rebase.
Imagine rearranging steps in a recipe.
You got /4 concepts.