Intermediate
Web & Software Development
Q65 / 100
In Git, what is the practical difference between `git merge` and `git rebase` when integrating a feature branch into main?
Correct! Well done.
Incorrect.
The correct answer is C) `git merge` creates a merge commit that preserves both histories as they happened, while `git rebase` rewrites the feature branch's commits on top of main, producing a linear history
C
Correct Answer
`git merge` creates a merge commit that preserves both histories as they happened, while `git rebase` rewrites the feature branch's commits on top of main, producing a linear history
Explanation
Merge records a new commit joining two histories, keeping an accurate (if branchy) record of what happened. Rebase replays your commits onto the tip of main, yielding a cleaner linear history but rewriting commit hashes — risky on shared branches.
Progress
65/100