Bird
0
0

After receiving feedback, you amend your last commit with:

medium📝 Command Output Q5 of 15
Git - Collaboration Workflows
After receiving feedback, you amend your last commit with:
git commit --amend -m 'Update fix as per review'

What happens when you run this?
AThe commit is deleted
BA new commit is added after the last commit
CAn error occurs because --amend requires push
DThe last commit message is replaced with the new message
Step-by-Step Solution
Solution:
  1. Step 1: Understand git commit --amend

    This command replaces the last commit with a new commit including updated message or changes.
  2. Step 2: Confirm effect on commit history

    The last commit is replaced, not added or deleted, no error occurs.
  3. Final Answer:

    The last commit message is replaced with the new message -> Option D
  4. Quick Check:

    git commit --amend updates last commit [OK]
Quick Trick: Use git commit --amend to update last commit message [OK]
Common Mistakes:
  • Thinking amend adds a new commit
  • Assuming amend deletes commits
  • Expecting errors without pushing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes