Bird
0
0

What will be the output of git log --oneline origin/main..feature-branch if feature-branch has 3 new commits not in main?

medium📝 Predict Output Q5 of 15
Git - Collaboration Workflows
What will be the output of git log --oneline origin/main..feature-branch if feature-branch has 3 new commits not in main?
ALists all commits from main branch
BLists the 3 new commits from feature-branch
CShows an empty log
DError: unknown revision
Step-by-Step Solution
Solution:
  1. Step 1: Understand git log range syntax

    'git log origin/main..feature-branch' shows commits reachable from feature-branch but not from origin/main.
  2. Step 2: Interpret output for 3 new commits

    If feature-branch has 3 new commits, the command lists those 3 commits in short form.
  3. Final Answer:

    Lists the 3 new commits from feature-branch -> Option B
  4. Quick Check:

    git log range shows new commits = Lists the 3 new commits from feature-branch [OK]
Quick Trick: git log A..B shows commits in B not in A [OK]
Common Mistakes:
  • Expecting main commits listed
  • Thinking output is empty
  • Confusing syntax causing error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes