問題文
A feature branch must be brought up to date with the main branch. The team requires that the resulting history show the feature commits as if they had been written on top of the current main. Which operation achieves that?
選択肢
- Merge main into the feature branch, which produces the same linear history without rewriting any commit, and the feature commits then appear after the main commits they build on.
- Rebase the feature branch onto main, which replays the feature commits on top of main and rewrites their identifiers.
- Cherry-pick each main commit onto the feature branch.
- Merge the feature branch into main with a fast-forward, which is possible in every case because a fast-forward simply moves the branch pointer and therefore always produces a linear history regardless of what happened on main.