Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Git graphs

sirene draws Mermaid git graphs (gitGraph) as images and as text:

gitGraph
  commit id: "init"
  branch develop
  commit id: "feature" tag: "beta"
  checkout main
  commit id: "hotfix"
  merge develop id: "release" tag: "v1.0"
the drawing of the mermaid source above

In images each branch is a lane, left to right by default, with commits in source order. Text always puts one commit per row, as git log --graph does. In the editor a git graph is read-only on the drawing side.

What is read

SyntaxDrawn as
gitGraph, gitGraph LR:, gitGraph TB:, gitGraph BT:lanes left to right, top to bottom, or bottom to top
commita circle on the current branch
commit id: "x"the id x; without one, a stable generated id such as 0-2245cbe
commit type: REVERSE / HIGHLIGHTa crossed circle / a filled square (⊗ / ■ in text)
commit tag: "v1"a tag label ([v1] in text)
branch name, branch name order: 2a new lane starting at the current commit
checkout name, switch namelater commits go on that branch
merge name (with id, tag, type)a ringed merge commit (◉), joined to the merged branch
cherry-pick id: "x" (with parent, tag)a commit tagged cherry-pick:x

msg: is read but not drawn. Lanes are ordered as in Mermaid: main, then branches without order in the order declared, then the others by order.

Errors

Merging a branch into itself or one with no commits, checking out an unknown branch, reusing a commit id or branch name, and cherry-picking a commit that is missing, already on the branch, or a merge without parent: are errors on that line; the rest of the graph is drawn.

Not drawn

gitGraph settings in frontmatter config (showBranches, mainBranchName, and the others) are ignored, and ids are never rotated.