Developing Applications and Automating Workflows Using Cisco Platforms (DEVASC) — Question 434
A developer is working on a branch called topic that was created from the master branch to add a new feature to the product. After making a few commits on the branch, the developer wants to compare the changes between the topic and the master branches. Which two Git commands are used? (Choose two.)
Answer options
- A. git diff topic - -cached
- B. git diff topic…master
- C. git diff topic HEAD
- D. git diff topic-master
- E. git diff topic master
Correct answer: B, E
Explanation
The correct commands to compare the topic branch with the master branch are 'git diff topic…master' and 'git diff topic master'. Option B uses the correct syntax for comparing two branches, while option E is also valid as it directly specifies the branches to compare. The other options either have incorrect syntax or do not achieve the intended comparison.