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?
- A. Your working tree already contains the 3 commits
- B. origin/main was updated but your local main was not; git merge origin/main (or git pull) will fast-forward it
- C. The 3 commits are lost unless you pull within the session
- 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.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A repository has untracked files temp.txt and out/build.log; .log is in .gitignore. What does git clean -fd remove?
- Assertion (A): You should not rebase commits that others have already based work on. Reason (R): Rebasing creates new commits with new…
- You run git branch -d experiment and Git refuses: 'the branch is not fully merged'. You force it with git branch -D. Which statement is…
- While running git rebase main on your feature branch, a conflict appears. In this situation, what do git checkout --ours and --theirs…
- A feature branch is merged into main with git merge --no-ff feature, although main had not moved since feature branched. What is the result?
- A developer wants to find out which commit introduced the string 'legacyPay(' anywhere in the code base, even though the commit messages…