Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Merge Conflicts: Detecting and Inspecting the Unresolved State

Create a disposable repository with one common base commit, then create two branches that make incompatible edits to the same tracked file. Attempt the merge and collect evidence before changing anything. Record: the non-zero exit status; `git status --short --branch`; the current `HEAD`; `git rev-parse MERGE_HEAD`; every `git ls-files --unmerged` stage for the conflicting path; the working-tree conflict markers; and the parent list of `HEAD`. Your evidence must demonstrate that the branch tip did not become a new merge commit even though Git entered merge state. Do not resolve, continue, or abort the merge until all observations are recorded. Success requires a state table with separate columns for command result, working tree, index, HEAD, and merge metadata. The table must explicitly distinguish “conflict exists,” “merge is in progress,” and “merge commit does not yet exist.”

Intermediate ~6 min read

Challenge 1

Complete the Git command to integrate the selected branch.

bash Your answer
git  topic

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to record working-tree and index state.

bash Your answer
git  --short --branch

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to resolve or verify a revision.

bash Your answer
git  MERGE_HEAD

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to inspect index entries.

bash Your answer
git  --unmerged

Press Ctrl⌘Enter to check your answer