Bird
0
0

Which Git command is used to fetch the latest changes from a pull request branch for review?

easy📝 Syntax Q3 of 15
Git - Collaboration Workflows
Which Git command is used to fetch the latest changes from a pull request branch for review?
Agit fetch origin pull/ID/head:BRANCHNAME
Bgit push origin main
Cgit merge --abort
Dgit branch -d BRANCHNAME
Step-by-Step Solution
Solution:
  1. Step 1: Understand fetching pull request branches

    To review a pull request locally, you fetch the PR branch using 'git fetch origin pull/ID/head:BRANCHNAME'.
  2. Step 2: Exclude unrelated commands

    'git push' uploads changes, 'git merge --abort' cancels merges, and 'git branch -d' deletes branches.
  3. Final Answer:

    git fetch origin pull/ID/head:BRANCHNAME -> Option A
  4. Quick Check:

    Fetch PR branch = git fetch origin pull/ID/head:BRANCHNAME [OK]
Quick Trick: Use git fetch with pull/ID/head to get PR branch [OK]
Common Mistakes:
  • Using git push instead of fetch
  • Confusing merge abort with fetch
  • Deleting branch instead of fetching

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes