Bird
0
0

You want to combine three commits into one during an interactive rebase. Which sequence of commands in the todo list achieves this?

hard📝 Workflow Q9 of 15
Git - Rebasing
You want to combine three commits into one during an interactive rebase. Which sequence of commands in the todo list achieves this?
Apick Commit1\nsquash Commit2\nsquash Commit3
Bpick Commit1\npick Commit2\npick Commit3
Csquash Commit1\npick Commit2\npick Commit3
Dedit Commit1\nsquash Commit2\npick Commit3
Step-by-Step Solution
Solution:
  1. Step 1: Understand how to squash commits

    Squashing merges commits into the previous one, so multiple squashes after a pick combine commits.
  2. Step 2: Apply to three commits

    Starting with 'pick' for Commit1, then 'squash' for Commit2 and Commit3 combines all three into one.
  3. Final Answer:

    pick Commit1\nsquash Commit2\nsquash Commit3 -> Option A
  4. Quick Check:

    Use pick then squash to combine commits [OK]
Quick Trick: Use pick then squash to merge multiple commits [OK]
Common Mistakes:
  • Starting with squash instead of pick
  • Using pick for all commits
  • Mixing edit with squash incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes