Recall & Review
beginner
What does the
git rebase command do?It moves or combines a sequence of commits to a new base commit, helping to keep a clean, linear project history.
Click to reveal answer
beginner
How do you start a basic rebase of your current branch onto
main?Use
git rebase main while on your feature branch to replay your commits on top of main.Click to reveal answer
intermediate
What should you do if you encounter conflicts during a rebase?
Resolve the conflicts manually, then run
git rebase --continue to proceed with the rebase.Click to reveal answer
intermediate
What is the difference between
git merge and git rebase?git merge combines histories creating a merge commit; git rebase rewrites history to create a linear sequence of commits.Click to reveal answer
intermediate
Why should you avoid rebasing public branches?
Because rebasing rewrites history, it can confuse others who have based work on the original commits, causing conflicts.
Click to reveal answer
What command rebases your current branch onto the
main branch?✗ Incorrect
The command
git rebase main moves your current branch commits on top of the main branch.If a conflict happens during rebase, what is the next step?
✗ Incorrect
You must fix conflicts manually, then continue the rebase with
git rebase --continue.What does rebasing do to your commit history?
✗ Incorrect
Rebasing rewrites your commits to appear as if they were made on top of another branch.
Which is a risk of rebasing a public branch?
✗ Incorrect
Rebasing changes commit history, which can cause problems for others working on the same branch.
Which command cancels an ongoing rebase and returns to the original state?
✗ Incorrect
git rebase --abort stops the rebase and restores the branch to its state before rebasing.Explain the basic steps to perform a git rebase of your feature branch onto the main branch.
Think about how you move your work on top of the latest main branch.
You got /5 concepts.
Describe why rebasing can be useful and when it should be avoided.
Consider the benefits of clean history and the risks of changing shared history.
You got /5 concepts.