Developing Applications Using Cisco Core Platforms and APIs (DEVCOR) — Question 144
A developer is working on a bug fix. The existing branch named 'bugfix05328' needs to be merged with the current working primary branch named
'prim404880077'. All changes must be integrated into a single commit instead of preserving them as individual commits. Which git command must be used?
Answer options
- A. git checkout ג€" ג€"squash bugfix05328
- B. git merge ג€" ג€"squash bugfix05328
- C. git rebase ג€" ג€"merge bugfix05328
- D. git push ג€" ג€"rebase bugfix05328
Correct answer: B
Explanation
The correct command is 'git merge --squash bugfix05328', which combines all changes from the specified branch into a single commit. The other options are incorrect because 'git checkout' is used for switching branches, 'git rebase --merge' is not a valid option, and 'git push --rebase' does not perform the necessary merge operation.