Bird
0
0

Why is it important to set an upstream branch when pushing a new branch to remote?

hard📝 Conceptual Q10 of 15
Git - Remote Repositories
Why is it important to set an upstream branch when pushing a new branch to remote?
AIt allows git to know which remote branch to push and pull by default.
BIt automatically merges remote changes into local branch.
CIt deletes the remote branch when local branch is deleted.
DIt prevents other users from pushing to the branch.
Step-by-Step Solution
Solution:
  1. Step 1: Understand upstream branch purpose

    Setting upstream links local branch to a remote branch for default push and pull operations.
  2. Step 2: Clarify what upstream does not do

    It does not merge changes automatically, delete branches, or control user permissions.
  3. Final Answer:

    It allows git to know which remote branch to push and pull by default. -> Option A
  4. Quick Check:

    Upstream sets default remote branch for push/pull [OK]
Quick Trick: Upstream branch sets default push/pull target [OK]
Common Mistakes:
  • Thinking upstream merges changes automatically
  • Confusing upstream with branch deletion
  • Assuming upstream controls permissions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes