What you are looking at
GitEngine is Git's core, written again from first principles in Go: a content-addressed object store, an index, refs, and seventeen commands including three-way merge with diff3-style conflicts and rebase. The chart above is a live repository running in your browser. The hashing is not imitated: every object is serialized exactly the way Git serializes it and hashed with SHA-1, so the hashes you see are the hashes native Git would produce for the same bytes.
Read it downstream. The headwaters are your working tree, one tributary per file. The staging pool is the index. The channels are branches, and each gold marker is a commit: a confluence where the pool's contents joined the record. The sediment is the object store itself, every blob, tree and commit laid down as a stratum with its hash.
How the river reads
- Edit a file in the notebook. Its tributary marks itself changed.
- add . stages it: the file's content is hashed into a blob and the pool level rises.
- commit writes a tree from the pool, then a commit object pointing at that tree and at its parent. A new confluence appears on the channel, and the new strata glow gold for a step.
- branch exp then checkout exp opens a second channel from the same confluence. Commits on it braid away from main.
- merge exp finds the merge base by walking both ancestries, then joins the two channels. If both sides changed the same lines, the join becomes rapids: conflict markers land in the file, and the next commit seals the merge with two parents.
Try this
- Let the demo braid and merge on its own, then click the merge confluence. The core sample shows a commit object with two
parentlines, which is all a merge commit is. - Click any blob stratum. The core sample prints the exact
printf | git hash-object --stdincommand; paste it into a terminal with real Git and the hash will match. - Force rapids yourself:
checkout exp, edit README.md,add .,commit -m 'exp',checkout main,merge exp. Both channels changed the same file, so the merge stops and asks you. - Drop a real text file onto the page. It lands in the headwaters, untracked, until you add it.
Gauge readings, measured
Parity with native Git is proved by a differential suite that runs every scenario through both GitEngine and git and compares the resulting hashes: commit chains, merge bases, merge commits and rebased tips are identical byte for byte. The suite caught three real encoding bugs on its first day, which is why it exists.
To check it: clone the repository and run go test ./difftest/. It needs a real git on your path, because that is what it compares against.