Bird
0
0

After running git fetch origin, you run git log HEAD..origin/main. What does this command show?

medium📝 Command Output Q5 of 15
Git - Remote Repositories
After running git fetch origin, you run git log HEAD..origin/main. What does this command show?
ANo commits because fetch merges automatically
BCommits on origin/main that are not in your current branch
CAll commits in both branches
DCommits on your current branch not in origin/main
Step-by-Step Solution
Solution:
  1. Step 1: Understand the log range syntax

    git log A..B shows commits reachable from B but not from A.

  2. Step 2: Apply to HEAD and origin/main

    HEAD..origin/main lists commits on remote branch not in local current branch.

  3. Final Answer:

    Commits on origin/main that are not in your current branch -> Option B
  4. Quick Check:

    Log HEAD..origin/main = remote commits not local [OK]
Quick Trick: Use git log HEAD..origin/main to see remote-only commits [OK]
Common Mistakes:
  • Reversing the commit range meaning
  • Assuming fetch merges automatically
  • Expecting all commits instead of difference

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes