Recall & Review
beginner
What command starts an interactive rebase to edit commit messages?
Use
git rebase -i HEAD~n where n is the number of commits you want to edit.Click to reveal answer
beginner
In an interactive rebase, how do you mark a commit to edit its message?
Change the word
pick to reword next to the commit you want to edit.Click to reveal answer
beginner
What happens after you save and close the rebase todo list with
reword commits?Git opens an editor for each
reword commit so you can change its message.Click to reveal answer
beginner
How do you finish the rebase after editing commit messages?
Save and close the commit message editor for each commit, then Git completes the rebase automatically.
Click to reveal answer
intermediate
Why should you be careful when rebasing commits that are already shared with others?
Because rebasing rewrites history, it can cause problems for others who have the old commits.
Click to reveal answer
Which command lets you edit the last 3 commit messages?
✗ Incorrect
The command
git rebase -i HEAD~3 opens an interactive rebase for the last 3 commits.In the rebase todo list, which word should you replace
pick with to change a commit message?✗ Incorrect
Use
reword to tell Git you want to change the commit message.What does Git do after you save the rebase todo list with
reword commits?✗ Incorrect
Git opens the editor for each
reword commit so you can edit the message.What should you do after editing all commit messages during a rebase?
✗ Incorrect
After editing messages, saving and closing the editor lets Git complete the rebase.
Why is it risky to rebase commits that others have already pulled?
✗ Incorrect
Rebasing rewrites commit history, which can cause problems for collaborators who have the old commits.
Explain the steps to edit commit messages using interactive rebase.
Think about how you tell Git which commits to change and how you update messages.
You got /5 concepts.
Why should you avoid rebasing commits that have been pushed to a shared repository?
Consider what happens when history changes after sharing.
You got /4 concepts.