Mermaid for

Git graphs

Make your branching strategy easy to follow

Draw branches, commits, and merges to explain a branching strategy, document a release process, or onboard contributors.

What is a Git graph?

A Git graph is a diagram of a repository’s commit history: branches, commits, merges, and the order they happened in. Linus Torvalds created Git in 2005, and it is now the standard version control system in software development. Diagramming Git history helps teams agree on a branching strategy, review a release process, and onboard contributors without reading terminal output.

In Mermaid, you write a Git graph as a sequence of Git-style commands: commit, branch, checkout, merge, and cherry-pick. You can add commit IDs, tags, and commit types, and render the graph left to right or top to bottom. Mermaid draws the history you describe. It does not read from a live repository.

What you can map
with a Git graph

Branch and merge strategies

Release and hotfix workflows

Feature branch timelines

Git Flow and trunk-based development patterns

Rebase and cherry-pick sequences

Onboarding documentation for new contributors

Code review and PR workflows

Branch and merge strategies

Release and hotfix workflows

Feature branch timelines

Git Flow and trunk-based development patterns

Rebase and cherry-pick sequences

Onboarding documentation for new contributors

Code review and PR workflows

Who uses Git graphs
on Mermaid

Developers

Visualize your branching strategy to spot complexity, communicate workflow, or document a release.

Tech Leads

Review branching decisions in architecture discussions or document the team’s Git workflow for new contributors.

DevOps Engineers

Document release pipelines and deployment branching strategies alongside your CI/CD configuration.

Project Managers

Understand and communicate how development work is organized across branches and releases.

When a Git graph is
the right call

Fast, accurate, editable, and actionable.

Describe your idea and get a diagram you can refine, then share with your team instantly.

FAQ

Common questions about building Git graphs in Mermaid.

FAQ Icon