Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Fast-Forward vs True Merge: Commit-Graph Outcomes

Create three disposable repositories. In the first, construct a descendant relationship and perform a default fast-forward. Record the old and new `main` object IDs and prove that the new tip already existed before the merge. In the second, construct divergent histories and perform a true merge; record the new merge commit and its parents. In the third, construct a fast-forwardable history, compare default merge with `--no-ff`, then construct a divergent history and prove that `--ff-only` refuses it. Your evidence must include exit statuses, object IDs, and parent lists. Do not infer the outcome solely from file content. Success requires a written state table for each experiment: pre-merge branch tips, ancestry relationship, command, exit status, post-merge branch tip, and parent list. The table must distinguish “new commit created” from “existing commit adopted.”

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 integrate the selected branch.

bash Your answer
git  --no-ff --no-edit topic

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to integrate the selected branch.

bash Your answer
git  --ff-only topic

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to integrate the selected branch.

bash Your answer
git  --no-edit topic

Press Ctrl⌘Enter to check your answer