All posts
MermaidGitVersion ControlTimelineDocumentation

Visualizing git commit history as a timeline with Mermaid

6 min readThe MermaidCreator team

Every repository has a story. A feature shipped, a critical bug was fixed, a major refactor was completed, and a team milestone was reached. These moments live scattered across commit logs and git tags, invisible to new team members and easy to forget when reviewing old pull requests.

Mermaid timeline diagrams let you map your repository's narrative—not just the commits, but the meaning behind them. Combined with git log and thoughtful annotations, timelines become a visual history that anyone can scan in seconds.

What a timeline diagram shows

A Mermaid timeline is a horizontal or vertical sequence of events with dates and descriptions. For git repositories, you use it to highlight:

  • Major releases — version tags and ship dates
  • Feature milestones — when key features shipped
  • Bug fixes — critical incidents and resolutions
  • Architecture changes — refactors or migrations
  • Team events — hiring, onboarding, retrospectives

The timeline isn't a replacement for git log—it's a guided tour of the commits that mattered.

Timeline syntax in Mermaid

A Mermaid timeline lists events in chronological order:

timeline
    title Repository Milestones
    2024-01 : Initial Launch : Added auth system
    2024-03 : Beta Release : Fixed critical bugs, optimized performance
    2024-06 : v1.0 Stable : Full feature parity, security audit passed
    2024-09 : Analytics Integration : Added event tracking, improved dashboards
    2025-01 : Team Growth : Hired two engineers, began v2 planning
    2025-06 : v2 Preview : New UI, API v2, migration tooling

Each line is a date (YYYY-MM or YYYY-MM-DD), a title, and optional details. The timeline renders in chronological order from top to bottom.

Use case: mapping a product repository's first year

Here's how a SaaS product might document its first year:

timeline
    title MermaidCreator First Year
    2025-01 : MVP Launch : Core editor, basic diagram types, free tier
    2025-02 : User Feedback : Added sequence diagrams, improved export
    2025-03 : Collaboration v0.1 : Real-time comments, presence cursors
    2025-04 : GitHub Integration : Generate diagrams from repositories
    2025-05 : Pro Tier : Unlimited diagrams, custom themes, analytics
    2025-06 : Database Migration : Scaled to handle 100k+ diagrams
    2025-07 : API Release : Public API for diagram generation
    2025-08 : Team Plan : Workspaces, member invites, role-based access
    2025-09 : AI Features : GPT-powered diagram generation and editing
    2025-10 : Security Audit : SOC 2 Type II compliance, encryption at rest
    2025-11 : Marketplace : Diagram templates, community contributions
    2025-12 : Series A : $5M funding, plan for enterprise features

This timeline tells the company's story at a glance. A new engineer scanning it understands the product evolution—what happened when and why the codebase looks the way it does.

Connecting timelines to git commits

To tie a timeline to actual commits, include commit SHAs or tags in your timeline comments. In your repository documentation, reference both:

timeline
    title Data Layer Refactor
    2025-04-15 : Query abstraction : Commit abc123d (WIP)
    2025-04-22 : Caching layer added : Commit def456e, tag v2.1-beta
    2025-04-28 : RLS policies rewritten : Commit ghi789f, PR #342
    2025-05-05 : Performance audit complete : Commit jkl012g, tag v2.1
    2025-05-12 : Monitoring dashboard live : Commit mno345h

Team members can then run git show abc123d to inspect the commit that corresponds to each milestone.

Real-world example: incident response and resolution

Timelines are especially powerful for documenting incidents. Pair them with a runbook:

timeline
    title Authentication Service Outage - 2025-06-15
    2025-06-15 10:30 : Outage detected : Alert fired, 95% of auth requests failing
    2025-06-15 10:35 : Root cause identified : Database connection pool exhausted (commit xyz789)
    2025-06-15 10:40 : Temporary mitigation : Deployed hotfix, restarted service
    2025-06-15 10:50 : Partial recovery : 60% of traffic restored, queuing backlog
    2025-06-15 11:15 : Full recovery : All auth requests nominal again
    2025-06-15 14:00 : Permanent fix merged : PR #891, added connection timeout
    2025-06-16 : Postmortem published : Identified 3 process improvements

This becomes part of your incident documentation. New team members understand what happened, in what order, and what was learned.

Using timelines in pull request descriptions

When you're opening a PR that ships a significant feature, include a timeline snippet that shows the journey from concept to ship:

timeline
    title Collaboration Feature Rollout
    2025-05-01 : Design review : Architecture approved
    2025-05-15 : Backend implementation : RLS policies, comment table, API endpoints
    2025-06-01 : Frontend UI : Comment panel, thread view, mention support
    2025-06-10 : Testing & refinement : Beta with 10 early users, bug fixes
    2025-06-15 : Performance validation : Tested at scale with 10k comments
    2025-06-20 : General availability : Feature flag flipped, analytics enabled

Reviewers see not just the code changes but the context of when each piece was built. It's especially useful for long-running features that span multiple PRs.

Best practices for repository timelines

  • Start high-level — your first timeline should cover major releases and features, not every commit
  • Use consistent date formats — stick to YYYY-MM-DD so they sort correctly
  • Link to issues or PRs — "v2 Planning" is vague; "v2 Planning (#456)" is actionable
  • Keep it in your repo — store the timeline markdown in a docs/ folder or HISTORY.md so it evolves with the project
  • Update after every major milestone — treat the timeline like a living changelog
  • Use short, descriptive titles — "Fixed auth bug" is better than "Work"

When to use timelines vs. other diagrams

Timelines are sequential; other diagrams show structure or flow:

Use Timelines ForUse Flowcharts ForUse Gantt For
Historical narrativesProcess logic & decision pathsProject scheduling & dependencies
Release notes & milestonesWorkflows & approval chainsTask duration & resource allocation
Incident postmortemsAlgorithm flowTimeline with effort estimates
Repository historyState transitionsCritical path analysis

Flowcharts show how something works. Gantt charts show when tasks happen and how long they take. Timelines show what happened when, emphasizing narrative and meaning. For git history, timelines connect the commits to the story.

Limitations and workarounds

  • No branching in timelines — timelines are linear. If multiple parallel efforts happened, document each separately
  • No dependency arrows — timelines don't show prerequisites. For complex project scheduling, use Gantt
  • Manual updates required — the timeline doesn't auto-pull from git; you curate it by hand

These constraints are features, not bugs. By hand-curating the timeline, you decide what matters—and that intentionality is what makes it a powerful communication tool.

FAQ

Should I include every commit in the timeline?
No. A timeline of every commit is just git log in a fancy format. Curate to the commits that matter—releases, feature milestones, critical bug fixes, refactors. Aim for 10–20 events per year.

Can I export a timeline as an image?
Yes. In MermaidCreator, use the export button to download PNG or SVG. You can then embed it in presentations, documentation, or wikis.

How do I keep the timeline in sync with git history?
Treat the timeline like a changelog. After each major milestone, update both the timeline diagram and your HISTORY.md or CHANGELOG.md. Mention the timeline in your PR template as a reminder.

Can I use timelines for sprint planning?
Yes—timelines work well for backlog narratives ("Sprint 1: Foundation", "Sprint 2: Core Features"). For detailed task scheduling and dependencies, use Gantt charts instead.

Document your repository's story in the MermaidCreator editor—timelines make history navigable and memorable.

Related posts