Testing and Deployment
Production runs release v2.4.0, while main contains unreleased features and a self-contained security-fix commit. How should a developer prepare a patch containing only the production code and that fix?
Show the answer
Correct answerA. Branch from v2.4.0 and cherry-pick the security-fix commit.
AWhy this is right: The release baseline excludes unreleased features, and cherry-picking adds only the selected fix.
BWhy not this: Starting from main retains unreleased features; merging the older release does not remove them.
CWhy not this: Merging main brings its unreleased changes into the maintenance branch.
DWhy not this: This retains unreleased features while removing the required security fix.
A branch from the production release establishes the correct baseline, and cherry-picking applies only the selected fix. Merging main into that branch also brings in the unreleased features.