Skip to content
rajin

31Capstone: simulate team collaboration and conflicts

capstone45–60 minHandbook pp. 67–68 Not started

Warm-up · from “Capstone: build a repository with plumbing”

Which plumbing command writes a tree from the Index?

No notes: write what you remember, then check. Recalling before reading is what makes it stick.

The problem

Two local developers start from the same release, edit the same configuration and try to publish. Resolve the conflict without losing either history.

After this lesson you can

  • Simulate a rejected push.

  • Inspect remote divergence.

  • Resolve all conflict stages and publish a verified merge.

Key terms

Full glossary

Say what each term means, then open it to check.

  • Commit · from lesson 7

    Object identifying a root tree, parent(s), metadata and message.

  • Ref · from lesson 3

    Name identifying an object; branch refs usually identify commits.

Visual mental model

  1. Peer pushes
  2. Local pushrejected
  3. fetch + merge
  4. server mainmerge commit

Build the mental model

Set up a bare local server, a main repository and a peer clone. Commit timeout=10 in the first repository, push it and clone the peer. Both developers independently edit the configuration: peer chooses 20 and pushes; main chooses 30 and attempts to push. Predict which update fails and why. Then fetch, inspect divergence and merge origin/main into local main.

SimulationTwo developers, one server

A simplified model for building intuition. It does not read your sandbox; use the terminal for real behaviour.

SimulationResolve to timeout=25

A simplified model for building intuition. It does not read your sandbox; use the terminal for real behaviour.

Under the hood

Your required product behavior is timeout=25. Inspect the base, ours and theirs before resolving. Stage the chosen result, verify it and commit the merge. Push only after verifying the resulting graph and clean status. Confirm that the server points to your final merge commit. This integrates the concepts of refs, three states, merging and remotes without using a live server.

Common mistake · important nuance

Never use a forced push to bypass this conflict. The goal is to preserve both developers' work in history.

Move between parts freely. Completion counts only what you verify and answer.