What is the difference between "git merge" and "git rebase" when integrating changes from one branch into another?
Correct! Well done.
Incorrect.
The correct answer is A) "git merge" combines histories with a new two-parent merge commit, preserving the exact history of both branches, while "git rebase" rewrites the current branch's commits onto the target branch, producing a linear history with no merge commit
Correct Answer
"git merge" combines histories with a new two-parent merge commit, preserving the exact history of both branches, while "git rebase" rewrites the current branch's commits onto the target branch, producing a linear history with no merge commit
Rebasing creates a cleaner, linear history by replaying commits onto a new base, but it rewrites commit hashes — which is risky on shared/public branches since it changes history that others may have based work on.