Bird
0
0

What will happen after running:

medium📝 Command Output Q5 of 15
Git - Remote Repositories
What will happen after running:
git push -u origin new-feature

assuming new-feature is a new local branch?
APushes the branch and sets it to track origin/new-feature
BPushes the branch but does not set tracking
CFails because branch does not exist remotely
DDeletes the remote branch named new-feature
Step-by-Step Solution
Solution:
  1. Step 1: Understand git push -u option

    The -u flag sets the upstream (tracking) branch after pushing.
  2. Step 2: Effect on new local branch

    The command pushes new-feature to remote and sets local branch to track origin/new-feature.
  3. Final Answer:

    Pushes the branch and sets it to track origin/new-feature -> Option A
  4. Quick Check:

    git push -u sets tracking branch [OK]
Quick Trick: Use 'git push -u' to push and track remote branch [OK]
Common Mistakes:
  • Thinking push fails if remote branch missing
  • Assuming -u does not set tracking
  • Confusing push with branch deletion

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes