GH-900 · Question #97
What command should you type to create and switch over to a new branch?
The correct answer is B. git checkout -b newBranchName. git checkout -b <new-branch> Create a new branch named <new-branch>, start it at <start-point>, and check the resulting [Not C] git checkout [<branch>] To prepare for working on <branch>, switch to it by updating the index and the files in the working tree, and by pointing HEAD…
Question
What command should you type to create and switch over to a new branch?
Options
- Agit checkout -n newBranchName
- Bgit checkout -b newBranchName
- Cgit checkout newBranchName
- Dgit branch newBranchName
How the community answered
(53 responses)- A2% (1)
- B91% (48)
- C6% (3)
- D2% (1)
Explanation
git checkout -b <new-branch> Create a new branch named <new-branch>, start it at <start-point>, and check the resulting [Not C] git checkout [<branch>] To prepare for working on <branch>, switch to it by updating the index and the files in the working tree, and by pointing HEAD at the branch. Local modifications to the files in the working tree are kept, so that they can be committed to the <branch>. https://git-scm.com/docs/git-checkout
Topics
Community Discussion
No community discussion yet for this question.