
Answer-first summary for fast verification
Answer: git checkout -b new-feature; git pull origin main; git checkout main; git merge new-feature
The correct sequence of commands involves creating a new branch with 'git checkout -b new-feature', pulling the latest changes from the remote repository with 'git pull origin main', switching back to the main branch with 'git checkout main', and merging the new feature branch with 'git merge new-feature'.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are using Git for version control in a project that involves multiple developers. Which of the following Git commands would you use to create a new branch, update the local repository with changes from the remote repository, and merge a branch back into the main branch?
A
git branch new-feature; git pull origin main; git merge new-feature
B
git checkout -b new-feature; git fetch origin; git merge new-feature
C
git branch new-feature; git pull origin main; git checkout main; git merge new-feature
D
git checkout -b new-feature; git pull origin main; git checkout main; git merge new-feature
No comments yet.