Bird
0
0

You want to create a local branch release that tracks remote origin/release, switch to it, and immediately push it. Which sequence is correct?

hard📝 Workflow Q8 of 15
Git - Remote Repositories
You want to create a local branch release that tracks remote origin/release, switch to it, and immediately push it. Which sequence is correct?
Agit push -u origin release git checkout -b release origin/release
Bgit branch release origin/release git push origin release
Cgit checkout release git push -u origin release
Dgit checkout -b release origin/release git push -u origin release
Step-by-Step Solution
Solution:
  1. Step 1: Create local branch tracking remote

    Use git checkout -b release origin/release to create and track remote branch.
  2. Step 2: Push and set upstream

    Then run git push -u origin release to push and confirm tracking.
  3. Final Answer:

    git checkout -b release origin/release git push -u origin release -> Option D
  4. Quick Check:

    Create tracking branch then push with -u [OK]
Quick Trick: Create tracking branch first, then push with -u [OK]
Common Mistakes:
  • Pushing before creating local branch
  • Not using -u to set upstream on push
  • Trying to checkout branch before it exists locally

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes