Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to amend the last commit message.
Git
git commit --amend -m "[1]"
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
git push instead of git commit --amend.Forgetting to put the message in quotes.
✗ Incorrect
The git commit --amend -m command lets you change the last commit message.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Repeating
--amend option unnecessarily.Using
--message when not changing the message.✗ Incorrect
The --no-edit option lets you amend the last commit without changing the message.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting the message causes syntax errors.
Mismatched quotes cause errors.
✗ Incorrect
The commit message must be inside quotes to be treated as a single string.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
--no-edit with a new message.Forgetting the
-m flag for the message.✗ Incorrect
Use --amend to change the last commit and -m to provide a new message.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Not using force push after amending a pushed commit.
Mixing up the order of options.
✗ Incorrect
First, amend the commit with --amend, add the message with -m, then force push with push --force.