0
0
Gitdevops~10 mins

Editing commit messages with rebase 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'
A5
B2
C3
D4
Attempts:
3 left
💡 Hint
Common Mistakes
Using HEAD~2 or HEAD~4 instead of HEAD~3.
Forgetting the -i flag for interactive rebase.
2fill in blank
medium

Complete the command to change the commit message of a commit during rebase.

Git
In the rebase todo list, replace 'pick' with '[1]' to edit the commit message.
Drag options to blanks, or click blank then click option'
Adrop
Bedit
Csquash
Dfixup
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'squash' or 'fixup' instead of 'edit' to change messages.
Not replacing 'pick' with any command.
3fill in blank
hard

Fix the error in the command to continue rebase after editing a commit message.

Git
After editing the commit message, run 'git [1] --continue' to proceed.
Drag options to blanks, or click blank then click option'
Arebase
Bpush
Ccommit
Dmerge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git commit --continue' or 'git push --continue'.
Using 'git merge --continue' which is for merges, not rebase.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps commit hashes to their messages, filtering commits with messages containing 'fix'.

Git
{commit.[1]: commit.[2] for commit in commits if 'fix' in commit.message}
Drag options to blanks, or click blank then click option'
Ahexsha
Bauthor
Cmessage
Ddate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'author' or 'date' instead of 'hexsha' or 'message'.
Confusing commit attributes.
5fill in blank
hard

Fill all three blanks to write a git command that amends the last commit with a new message without changing the commit content.

Git
git commit --amend -m "[1]" && git [2] origin [3]
Drag options to blanks, or click blank then click option'
AUpdated commit message
Bpush
CHEAD
Dpull
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pull' instead of 'push' after amending.
Not specifying the branch or HEAD when pushing.