200-901 · Question #391
A developer is working on a new feature in a branch named 'newfeat123456789' and the current working primary branch is named 'prim987654321'. The developer requires a merge commit during a fast…
The correct answer is A. git merge --no-ff newfeat123456789. By default, Git performs a fast-forward merge when possible, simply moving the branch pointer forward without creating a merge commit. The --no-ff flag (no fast-forward) forces Git to always create a merge commit, preserving the record that a feature branch was merged. The…
Question
A developer is working on a new feature in a branch named 'newfeat123456789' and the current working primary branch is named 'prim987654321'. The developer requires a merge commit during a fast forward merge for record-keeping purposes. Which Git command must be used?
Options
- Agit merge --no-ff newfeat123456789
- Bgit commit --no-ff newfeat123456789
- Cgit add --commit-ff newfeat123456789
- Dgit reset --commit-ff newfeat123456789
How the community answered
(24 responses)- A96% (23)
- B4% (1)
Explanation
By default, Git performs a fast-forward merge when possible, simply moving the branch pointer forward without creating a merge commit. The --no-ff flag (no fast-forward) forces Git to always create a merge commit, preserving the record that a feature branch was merged. The correct command is git merge --no-ff newfeat123456789, run from the primary branch prim987654321. Options B, C, and D use invalid Git subcommands or flags.
Topics
Community Discussion
No community discussion yet for this question.