Bird
0
0

After running git rebase -i HEAD~2 and marking the first commit as edit, what command should you run next to change the commit message?

medium📝 Command Output Q4 of 15
Git - Rebasing
After running git rebase -i HEAD~2 and marking the first commit as edit, what command should you run next to change the commit message?
Agit merge --edit
Bgit commit --amend
Cgit reset HEAD~1
Dgit rebase --continue
Step-by-Step Solution
Solution:
  1. Step 1: Understand the rebase edit process

    When a commit is marked as edit, rebase pauses and allows you to amend the commit.
  2. Step 2: Use the correct command to change the message

    git commit --amend lets you modify the commit message before continuing the rebase.
  3. Final Answer:

    git commit --amend -> Option B
  4. Quick Check:

    Change commit message during rebase = git commit --amend [OK]
Quick Trick: Use git commit --amend to edit commit message during rebase [OK]
Common Mistakes:
  • Running git rebase --continue before amending
  • Using git reset instead of amend
  • Trying to merge during rebase

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes