0
0
Gitdevops~10 mins

Reordering commits in Git - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
A4
B2
C3
D5
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.
2fill in blank
medium

Complete 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'
AHEAD~2
BHEAD~3
CHEAD~4
DHEAD~5
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing the wrong number of commits to rebase.
Not using the interactive flag '-i'.
3fill in blank
hard

Fix 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'
A2
B5
C3
D4
Attempts:
3 left
💡 Hint
Common Mistakes
Using HEAD~3 instead of HEAD~4.
Omitting the '-i' flag.
4fill in blank
hard

Fill 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'
A3
B4
Csave
Dexit
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.
5fill in blank
hard

Fill 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'
A3
Bsave
Clog
Dexit
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.