Git - RebasingWhat is the main purpose of squashing commits in Git?ATo revert the last commit without changing historyBTo combine multiple commits into one for a cleaner historyCTo create a new branch from the current commitDTo delete all commits from the repositoryCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand commit history managementSquashing is used to combine several commits into a single commit to simplify the commit history.Step 2: Identify the purpose of squashingThis helps keep the project history clean and easier to read by reducing clutter from many small commits.Final Answer:To combine multiple commits into one for a cleaner history -> Option BQuick Check:Squashing = combine commits [OK]Quick Trick: Squash = combine commits to clean history [OK]Common Mistakes:Thinking squashing deletes commits permanentlyConfusing squashing with branchingBelieving squashing reverts commits
Master "Rebasing" in Git9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Git Quizzes Cherry-Pick and Advanced Merging - Why cherry-pick is useful - Quiz 4medium Collaboration Workflows - Code review in pull requests - Quiz 13medium Collaboration Workflows - Pull request process - Quiz 5medium Rebasing - Golden rule of rebasing (never rebase public) - Quiz 5medium Remote Repositories - git remote add origin - Quiz 8hard Stashing - git stash pop to restore - Quiz 15hard Stashing - git stash to save changes - Quiz 13medium Tagging - Lightweight vs annotated tags - Quiz 3easy Tagging - Tagging specific commits - Quiz 10hard Tagging - Why tags mark important points - Quiz 8hard