nerdexam
Cisco

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>…

Software Development and Design

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)
  • A
    91% (50)
  • B
    2% (1)
  • C
    2% (1)
  • D
    5% (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

#Git#Branching#Version Control#CLI

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice