Bird
0
0

What is the main purpose of squashing commits in Git?

easy📝 Conceptual Q11 of 15
Git - Rebasing
What is the main purpose of squashing commits in Git?
ATo revert the last commit without changing history
BTo combine multiple commits into one for a cleaner history
CTo create a new branch from the current commit
DTo delete all commits from the repository
Step-by-Step Solution
Solution:
  1. Step 1: Understand commit history management

    Squashing is used to combine several commits into a single commit to simplify the commit history.
  2. Step 2: Identify the purpose of squashing

    This helps keep the project history clean and easier to read by reducing clutter from many small commits.
  3. Final Answer:

    To combine multiple commits into one for a cleaner history -> Option B
  4. Quick Check:

    Squashing = combine commits [OK]
Quick Trick: Squash = combine commits to clean history [OK]
Common Mistakes:
  • Thinking squashing deletes commits permanently
  • Confusing squashing with branching
  • Believing squashing reverts commits

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes