A developer starts main and feature at C. Main advances through M1 to M2. Feature advances through F1 to F2, merges main to create J with parents F2 and M2, and then records F3. Main remains at M2 throughout these feature operations. The diagram shows every later commit and parent link.
With no pending file changes, the developer switches to main and runs git merge --ff-only feature. Assume no hooks or other operations create commits. How many new commits does this final command create? Answer as a whole number of commits.
Unlock full course notes by signing up
Count an integrated history
A team has six commits shared by main and search. After that shared history, main has three additional commits and search has five different additional commits, as shown. There are no other commits or parent links. A developer completes an ordinary two-parent merge of search into main, creating one new merge commit.
Report how many commits search was ahead of main before merging, how many it was behind, and how many distinct commits are reachable from main afterward, including its tip. Give all three answers as whole numbers of commits.
What does a clean merge establish?
A developer checks out main at P and runs git merge preview, whose tip is Q. The histories shown have diverged. Git completes the ordinary two-parent merge without textual conflicts, creating commit M. No application tests have been run. Which statements are supported? Select all that apply.
Count names through branch maintenance
A developer is cleaning up branches after a release. Initially, there are exactly three local branches: main, draft and archive. All three point to the same commit, and draft is selected. None has a configured upstream.
Treat each table row as an independent experiment starting from this initial state. There is only one working tree, it has no uncommitted changes, and no other commands run. If a command is refused, record the unchanged state.
Complete the table with exact integer counts and the selected branch name. Count only local branches; count commits newly created by the command, not commits already present.