CS FundamentalsModerateTCS · Accenture

After git fetch, git status says: "Your branch is behind 'origin/main' by 3 commits, and can be fast-forwarded." Which statement is correct?

  1. A. Your working tree already contains the 3 commits
  2. B. origin/main was updated but your local main was not; git merge origin/main (or git pull) will fast-forward it
  3. C. The 3 commits are lost unless you pull within the session
  4. D. You must rebase because a fast-forward is impossible

Correct answer: B. origin/main was updated but your local main was not; git merge origin/main (or git pull) will fast-forward it

fetch updates remote-tracking refs only. 'Can be fast-forwarded' means you have no local commits that origin/main lacks, so moving main forward needs no merge commit.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic