Your docs belong in a Git repository

A docs database is convenient until you need history, review or a way out. Why we keep every page as a file in Git, and what that asks of the editor.

Sahil Gadimbayli

Founder & CTO

Engineering4 min read

Most docs tools store your pages in their database. You write in a nice editor, press publish, and the content lives in a table you never see. It's convenient right up to the day you need one of the things a database is bad at.

We started Typemark with the opposite rule: every page is a file in a Git repository, and the database is a cache of it. Here's why, and what that rule costs.

What files in Git give you

History you can trust. Someone changed the rate limit on your pricing page from 100 to 1,000 requests a minute. Was it a typo or a decision? With Git you run git log -p on the file and see who changed it, when, and the commit message that says why. Most docs databases keep a version list, if you're lucky. Few let you ask why.

Review where the code is reviewed. When docs live in Git, a pull request can change the API and its docs together. The reviewer sees both. Docs drift, the slow gap between what the product does and what the page says, mostly comes from these two changes living in different places.

A way out. Your pages are Markdown files with a bit of frontmatter. If you leave, you take the folder. There's no export button that half works and no migration script to write. A tool you can leave in an afternoon is a tool you can trust with your docs.

Every tool you already have. grep finds every page that mentions a deprecated flag. A linter catches broken links in CI. A script renames a product across 200 pages in one commit. Coding agents edit files well, and a repository is the format they understand best.

Branches. You can rewrite the getting started section on a branch for two weeks while the live one keeps working, then merge it on launch day.

The honest objection

If Git is so good, why does anyone use a database? Because Git is hostile to most of the people who should be writing docs.

Your support lead knows which questions come in every week. Your product manager knows what the next release changes. Neither wants to clone a repository, learn what a rebase is, or wait for an engineer to merge a typo fix. Hand them a Git workflow and they'll keep their knowledge in a chat thread instead.

That objection is real, and it's the reason most teams choose a database-backed tool and then regret it a year later.

Git underneath, an editor on top

Our answer is to keep Git as the source of truth and hide it from people who don't want it.

The visual editor writes Markdown files and commits them under the writer's own name. Your support lead sees a document editor. Your engineers see a commit in the history, with an author they recognise. If the repository is connected to GitHub, the change shows up there too, and a change pushed from someone's laptop shows up in the editor.

That design forces some discipline on us. The editor can't quietly reformat a file when someone opens it, because that would put noise in everyone's history. A save has to write back the bytes the writer changed and leave the rest of the file alone. Builds have to read from the repository, never from the database, so the two can't disagree about what's published.

Where should the docs live?

If you're moving docs into Git, the next question is which repository. There are two good answers.

Next to the code, in a docs/ folder of your product repository. Docs change in the same pull request as the feature, and nobody forgets. This works best when engineers write most of the docs.

In their own repository. Writers get permissions without access to the source, the history stays readable, and the docs can describe several products. This works best when a docs or support team owns them.

Either is fine. What matters is that the docs are files, the files have history, and changing them doesn't need a database migration or a vendor's export tool.

A quick test for your current setup

Ask three questions about the tool you use today:

  1. Can I see who changed this sentence, and why?
  2. Can a docs change be reviewed in the same place as the code change it describes?
  3. If we left tomorrow, would we have our pages as files by the afternoon?

If any answer is no, your docs are rented. We'd rather you owned them, whichever tool you pick.

Engineering4 min read

We never run your page's code

MDX lets a docs page run JavaScript. On a platform that compiles thousands of strangers' pages, we decided the safest sandbox is the one you never need.

Sahil Gadimbayli

AI and agents4 min read

Your next docs reader is an AI agent

More of your readers ask an assistant instead of opening your docs. Here's what that assistant needs from your site, and how to check what it sees.

Sahil Gadimbayli