350-901 practice question 3 of 35
A developer is working on an enhancement for an application feature and has made changes to a branch called ‘devcor-432436127a-enhance4‘. When merging the branch to production, conflicts occurred. Which Git command must the developer use to recreate the pre-merge state?
Full set: 430 questionsDomain Infrastructure and Automation
When a git merge operation results in conflicts, Git pauses the process, leaving the repository in a special "merging" state. The developer must manually resolve the conflicts before committing. If the developer decides to abandon the merge attempt entirely, the git merge --abort command is used. This command aborts the conflict resolution process and restores the repository and working directory to the state they were in just before the merge was initiated.
A. git merge -no-edit is incorrect because it is used to accept the auto-generated merge commit message without opening an editor. It does not abort a merge with conflicts.
C. git merge -revert is incorrect because -revert is not a valid option for the git merge command. git revert is a separate command used to undo a previously committed merge.
D. git merge --commit is incorrect because this is the default behavior to finalize a successful merge by creating a merge commit. It cannot be used when conflicts are present.
1. Official Git Documentation: The git-merge command documentation explicitly states the function of the --abort option.
Source: git-scm.com
Official Git Documentation
Reference: git-merge Documentation
OPTIONS section. " --abort Abort the current conflict resolution process
and try to reconstruct the pre-merge state."
Link: https://git-scm.com/docs/git-merge#options
2. MIT Courseware: University course materials on version control confirm this usage for handling merge conflicts.
Source: MIT Missing Semester of Your CS Education
Reference: Version Control (Git) Lecture Notes. "If at any point you want to give up and get back to the state before you started the merge
you can do that with git merge --abort."
Link: https://missing.csail.mit.edu/2020/version-control/ (Under the "Merge Conflicts" section).
Keep practicing
Take the free 350-901 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 350-901 practice questions
- Question 2An application has initiated an OAuth authorization code grant flow to get access to an A…
- Question 4An automated solution is needed to configure VMs in numerous cloud provider environments …
- Question 9A web application is being developed to provide online sales to a retailer. The customers…
- Question 11While developing an application following the 12-factor app methodology, which approach s…
- Question 16A user is receiving a 429 Too Many Requests error. Which scheme is the server employing t…
- Question 17What is a well-defined concept of GDPR compliance?
