Git graph (Mermaid)

Most branching arguments are people picturing different diagrams. Drawing it takes a minute. This one shows a release branch, a tagged hotfix, and the merge back to main.


#What this example shows

  • branch and checkout, which move where the next commit lands.

  • Tags, which is usually the part people care about.

  • A merge back into main, drawn explicitly.


#A worked example

Open it, edit it, or copy the source below.

Git graph (Mermaid)

The source, which you can paste into a new diagram and edit:

gitGraph
  commit id: "init"
  commit id: "feature A"
  branch release/1.0
  commit id: "stabilise"
  commit id: "rc1" tag: "1.0.0-rc1"
  checkout main
  commit id: "feature B"
  checkout release/1.0
  commit id: "release" tag: "1.0.0"
  commit id: "hotfix" tag: "1.0.1"
  checkout main
  merge release/1.0
  commit id: "feature C"

#Making it your own

  • Draw what your team actually does, not what the process document says.

  • Keep it to about a dozen commits; it is an illustration, not a history.

  • Add a second branch to show a long-lived feature branch if that is the argument.



Copy it. Change one line. See what happens.