Bird
0
0

Given these commits:

medium📝 Command Output Q13 of 15
Git - Rebasing
Given these commits:
commit1: Add README
commit2: Fix typo
commit3: Update README formatting
If you run git rebase -i HEAD~3 and squash commit2 and commit3 into commit1, what will the commit history show?
AOne commit combining messages from commit1, commit2, and commit3
BThree separate commits unchanged
COne commit with message from commit1 only
DTwo commits: commit1 and combined commit2+commit3
Step-by-Step Solution
Solution:
  1. Step 1: Understand squash behavior in interactive rebase

    Squashing merges commits into one, combining their changes and commit messages.
  2. Step 2: Result of squashing commit2 and commit3 into commit1

    The final commit will include all changes and combined commit messages from all three commits.
  3. Final Answer:

    One commit combining messages from commit1, commit2, and commit3 -> Option A
  4. Quick Check:

    Squash merges commits and messages [OK]
Quick Trick: Squash merges commits and their messages together [OK]
Common Mistakes:
  • Assuming only the first commit message remains
  • Expecting commits to stay separate after squash
  • Thinking squash deletes commit messages

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes