XK0-005 · Question #9970
A systems administrator has finished building a new feature for the monitoring software in a separate Git branch. Which of the following is the BEST method for adding the new feature to the…
The correct answer is A. Merge the changes from the feature branch to the master branch. The standard Git workflow for integrating a completed feature branch into the main/master branch is to perform a 'git merge'. From the master branch, running 'git merge <feature-branch>' incorporates the commits from the feature branch into master, preserving history and…
Question
Options
- AMerge the changes from the feature branch to the master branch.
- BSave the changes to the master branch automatically with each Git commit.
- CClone the feature branch into the master branch.
- DPull the changes from the feature branch into the master branch.
How the community answered
(51 responses)- A90% (46)
- B2% (1)
- C4% (2)
- D4% (2)
Explanation
The standard Git workflow for integrating a completed feature branch into the main/master branch is to perform a 'git merge'. From the master branch, running 'git merge <feature-branch>' incorporates the commits from the feature branch into master, preserving history and resolving differences. Option B is incorrect because commits do not automatically go to master. Option C is incorrect because 'clone' copies an entire repository, not a branch into another branch. Option D ('pull') is used to fetch and merge changes from a remote repository, not to merge a local feature branch - pulling from a feature branch into master is non-standard and error-prone. Merging is the correct and conventional approach.
Topics
Community Discussion
No community discussion yet for this question.