Developing Applications and Automating Workflows Using Cisco Platforms (DEVASC) — Question 320
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?
Answer options
- A. git merge --no-ff newfeat123456789
- B. git commit --no-ff newfeat123456789
- C. git add --commit-ff newfeat123456789
- D. git reset --commit-ff newfeat123456789
Correct answer: A
Explanation
The correct answer is A because the command 'git merge --no-ff newfeat123456789' explicitly prevents a fast forward merge, ensuring that a merge commit is created. Options B, C, and D are incorrect as they use commands that do not perform a merge operation; instead, they either create commits, stage files, or reset branches without merging.