Bird
0
0

Which Git command correctly creates a new local branch feature that tracks the remote branch origin/feature?

easy📝 Syntax Q12 of 15
Git - Remote Repositories
Which Git command correctly creates a new local branch feature that tracks the remote branch origin/feature?
Agit branch feature origin/feature
Bgit checkout --track origin/feature feature
Cgit checkout origin/feature feature
Dgit branch --track feature origin/feature
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct syntax for tracking branch creation

    The command to create a local branch tracking a remote branch is git branch --track local_branch remote_branch.
  2. Step 2: Match the command with options

    git branch --track feature origin/feature matches this syntax exactly: git branch --track feature origin/feature.
  3. Final Answer:

    git branch --track feature origin/feature -> Option D
  4. Quick Check:

    Use --track with git branch to link branches [OK]
Quick Trick: Use 'git branch --track' to link local to remote branch [OK]
Common Mistakes:
  • Omitting --track option
  • Using git checkout with wrong argument order
  • Confusing branch creation with checkout syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes