Bird
0
0

If you run git rebase -i HEAD~3 and change the second commit's action from pick to squash, what happens?

medium📝 Command Output Q5 of 15
Git - Rebasing
If you run git rebase -i HEAD~3 and change the second commit's action from pick to squash, what happens?
AThe second commit is combined with the first commit
BThe second commit is deleted
CThe second commit is applied twice
DThe second commit becomes a new branch
Step-by-Step Solution
Solution:
  1. Step 1: Understand squash action in rebase

    Squash merges the commit into the previous one, combining their changes.
  2. Step 2: Identify effect on second commit

    The second commit's changes merge into the first commit, creating one combined commit.
  3. Final Answer:

    The second commit is combined with the first commit -> Option A
  4. Quick Check:

    squash = combine commit with previous [OK]
Quick Trick: Use squash to merge commits during interactive rebase [OK]
Common Mistakes:
  • Thinking squash deletes commits
  • Assuming commits duplicate
  • Confusing squash with branching

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes