nerdexam
Cisco

200-901 · Question #238

Developer is working on a new feature and made changes on a branch named 'branch- 413667549a-new'. When merging the branch to production, conflicts occurred. Which Git command must the developer use…

The correct answer is D. git merge -- abort. When a git merge results in conflicts and the developer wants to cancel the merge entirely and return to the state before the merge was attempted, 'git merge --abort' is the correct command. It stops the in-progress merge and restores the working tree and index to the pre-merge…

Software Development and Design

Question

Developer is working on a new feature and made changes on a branch named 'branch- 413667549a-new'. When merging the branch to production, conflicts occurred. Which Git command must the developer use to recreate the pre-merge state?

Options

  • Agit merge -- no-edit
  • Bgit merge -- commit
  • Cgit merge -- revert
  • Dgit merge -- abort

How the community answered

(47 responses)
  • A
    6% (3)
  • B
    4% (2)
  • C
    2% (1)
  • D
    87% (41)

Explanation

When a git merge results in conflicts and the developer wants to cancel the merge entirely and return to the state before the merge was attempted, 'git merge --abort' is the correct command. It stops the in-progress merge and restores the working tree and index to the pre-merge commit. 'git merge --no-edit' accepts the auto-generated merge commit message without opening an editor - it does not abort. 'git merge --commit' forces a merge commit even when it would normally be fast-forwarded. 'git merge --revert' is not a valid git merge flag; to undo a completed merge, you would use 'git revert -m 1 <merge-commit>'.

Topics

#Git#Version Control#Merge Conflicts#Developer Tools

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice