Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to start an interactive rebase for the last 3 commits.
Git
git rebase -i HEAD~[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a number too small or too large will rebase the wrong number of commits.
Forgetting the '-i' flag disables interactive mode.
✗ Incorrect
Using 'HEAD~3' tells Git to rebase the last 3 commits interactively.
2fill in blank
mediumComplete the command to reorder commits by editing the rebase todo list.
Git
git rebase -i [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing the wrong number of commits to rebase.
Not using the interactive flag '-i'.
✗ Incorrect
You specify the commit range to reorder by using HEAD~3 for the last 3 commits.
3fill in blank
hardFix the error in the command to reorder the last 4 commits interactively.
Git
git rebase -i HEAD~[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using HEAD~3 instead of HEAD~4.
Omitting the '-i' flag.
✗ Incorrect
To reorder the last 4 commits, you must specify HEAD~4.
4fill in blank
hardFill both blanks to reorder commits by changing the order in the todo list and then saving.
Git
git rebase -i HEAD~[1] # In the editor, change the order of commits and then [2] to apply changes
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Not saving the file after editing the commit order.
Using the wrong number of commits in the rebase command.
✗ Incorrect
You start interactive rebase with HEAD~3 and then save the todo list to apply changes.
5fill in blank
hardFill all three blanks to reorder commits by starting interactive rebase, editing the todo list, and then confirming the rebase.
Git
git rebase -i HEAD~[1] # Edit the todo list to reorder commits and then [2] # After rebase, use git [3] to check commit history
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Not saving the todo list after editing.
Using 'git status' instead of 'git log' to check commits.
Using the wrong number of commits in the rebase command.
✗ Incorrect
Start with HEAD~3, save the todo list after editing, then check history with git log.