What is the difference between "git merge-base" and simply looking at the parent of the current commit?
Correct! Well done.
Incorrect.
The correct answer is A) "git merge-base <branch1> <branch2>" finds the best common ancestor shared by both branches' histories, possibly many commits back, not simply either branch's immediate parent — used for three-way merges and "git diff branch1...branch2"
Correct Answer
"git merge-base <branch1> <branch2>" finds the best common ancestor shared by both branches' histories, possibly many commits back, not simply either branch's immediate parent — used for three-way merges and "git diff branch1...branch2"
Finding the merge base is fundamental to how Git computes diffs between diverged branches (e.g. "git diff main...feature" shows changes on "feature" since it diverged from "main", using the merge base as the starting point, rather than a direct two-way diff of the tips).