Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Merge Conflict Resolution: From Unmerged Paths to a Resolved Index

Create a disposable repository with a common base and two branches that conflict on at least two tracked paths. Start the merge and record the unresolved state. Resolve exactly one path first. Prove with `git ls-files --unmerged` that the other path is still unresolved. Then resolve the remaining path, stage both, and verify that the unmerged query is empty. Use `git diff --cached` to record the exact snapshot you have prepared. Finally verify that `HEAD` has not moved and `MERGE_HEAD` still identifies the incoming commit. Do not run the final merge-completion command; that belongs to V440. Success requires evidence at three checkpoints: (1) both paths are initially unmerged, (2) exactly one remains after the first `git add`, and (3) none remain after the second resolution. Your final evidence must also show that resolving the index did not itself move HEAD or delete MERGE_HEAD.

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 inspect index entries.

bash Your answer
git  --unmerged

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to compare repository states.

bash Your answer
git  --cached

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to stage the path.

bash Your answer
git  first.txt

Press Ctrl⌘Enter to check your answer