Bird
0
0

Which Git command is used to switch to an existing feature branch named feature-ui?

easy📝 Conceptual Q2 of 15
Git - Collaboration Workflows
Which Git command is used to switch to an existing feature branch named feature-ui?
Agit branch feature-ui
Bgit checkout feature-ui
Cgit merge feature-ui
Dgit init feature-ui
Step-by-Step Solution
Solution:
  1. Step 1: Identify the command to switch branches

    The command git checkout <branch-name> switches to an existing branch.
  2. Step 2: Check other options

    git branch creates a branch, git merge merges branches, and git init initializes a repo. Only git checkout feature-ui switches to the branch.
  3. Final Answer:

    git checkout feature-ui -> Option B
  4. Quick Check:

    Switch branch = git checkout [OK]
Quick Trick: Use 'git checkout branch-name' to switch branches [OK]
Common Mistakes:
  • Using 'git branch' to switch branches
  • Confusing 'git merge' with switching branches
  • Trying to initialize a branch with 'git init'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes