0
0
Gitdevops~10 mins

Amending the last commit 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 amend the last commit message.

Git
git commit --amend -m "[1]"
Drag options to blanks, or click blank then click option'
AUpdated commit message
Bgit status
Cgit push
Dgit log
Attempts:
3 left
💡 Hint
Common Mistakes
Using git push instead of git commit --amend.
Forgetting to put the message in quotes.
2fill in blank
medium

Complete the command to amend the last commit without changing the message.

Git
git commit --amend [1]
Drag options to blanks, or click blank then click option'
A--reset-author
B--amend
C--no-edit
D--message
Attempts:
3 left
💡 Hint
Common Mistakes
Repeating --amend option unnecessarily.
Using --message when not changing the message.
3fill in blank
hard

Fix the error in the command to amend the last commit message.

Git
git commit --amend -m [1]
Drag options to blanks, or click blank then click option'
A"Updated message"
BUpdated message"
C'Updated message'
DUpdated message
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting the message causes syntax errors.
Mismatched quotes cause errors.
4fill in blank
hard

Fill both blanks to amend the last commit with a new message.

Git
git commit [1] [2] "Fix typo in README"
Drag options to blanks, or click blank then click option'
A--amend
B--no-edit
C--reset-author
D-m
Attempts:
3 left
💡 Hint
Common Mistakes
Using --no-edit with a new message.
Forgetting the -m flag for the message.
5fill in blank
hard

Fill all three blanks to amend the last commit with a new message and push force to origin.

Git
git commit [1] [2] "Add new feature" && git [3] origin main
Drag options to blanks, or click blank then click option'
A--amend
B-m
Cpush --force
D--reset-author
Attempts:
3 left
💡 Hint
Common Mistakes
Not using force push after amending a pushed commit.
Mixing up the order of options.