200-901 · Question #472
Which two commands create a new branch in a Git repository? (Choose two.)
The correct answer is A. git branch E. git checkout -b. The two commands that create a new branch in a Git repository are: git branch <mynewbranch>: This command creates a new branch named <mynewbranch> but does not switch to it immediately. You need to use a separate command to switch to the newly git checkout -b <mynewbranch>…
Question
Which two commands create a new branch in a Git repository? (Choose two.)
Options
- Agit branch
- Bgit checkout
- Cgit checkout
- Dgit branch
- Egit checkout -b
How the community answered
(55 responses)- A91% (50)
- B2% (1)
- C2% (1)
- D5% (3)
Explanation
The two commands that create a new branch in a Git repository are: git branch <mynewbranch>: This command creates a new branch named <mynewbranch> but does not switch to it immediately. You need to use a separate command to switch to the newly git checkout -b <mynewbranch>: This command creates a new branch named <mynewbranch> and immediately switches to it. It is a shortcut for creating and checking out a new branch in a
Topics
Community Discussion
No community discussion yet for this question.