Loading…
Loading…
One lane per branch, commits along it in the order you write them. Unlike the rest
of the language this family is imperative — branch, checkout, commit — because
a history's meaning is its order, and that is the model you already carry.
gitgraph
title: Release flow
commit Initial
commit Add auth [tag: v1.0]
branch feature
commit Start work
commit Fix tests
checkout main
merge feature [tag: v1.1]
commit Hotfix [highlight]
commit <label> — a commit on the current branch. The label is free text.branch <name> — opens a lane and switches to it, as Mermaid does.checkout <name> — switches to an existing lane (switch also works).merge <name> — a merge commit on the current branch, drawn as a curve back
from that branch's head. Merging a branch into itself is an error.cherry-pick <commit> — copies a commit onto this lane, drawn as a dashed
curve from the original. Reference it by its id: a label slugifies, so
commit Add auth is add-auth.[tag: v1.0] — a release marker above the dot.[highlight] — calls a commit out in orange.[reverse] — marks a revert in red (revert also works).[label: …] — replaces the text a merge or cherry-pick would write itself.gitgraph
title: Two streams
commit Scaffold
branch api
commit Add endpoints
checkout main
branch ui
commit Build the shell
checkout main
merge api
commit Bad deploy [reverse]
cherry-pick build-the-shell
merge ui [tag: v2.0]
Every commit takes the next column, whichever lane it is on — so two dots side by
side really did happen one after the other. A lane's first commit curves out of
whichever lane was active before it, which is what makes branch after two
commits attach to the second one rather than the first.
A Mermaid gitGraph converts directly: commit id:"…" and tag:"…" keep their
text, type: HIGHLIGHT / type: REVERSE become [highlight] / [reverse], and
branch / checkout / merge / cherry-pick map one to one. See
importing from Mermaid.