NewEdit your site from ChatGPT or Claude. Same rules as the built-in assistant.See how

← All guides

git-based cms

What Is a Git-Based CMS? How It Works

A Git-based CMS saves website content as files in your Git repository, not a database. How it works, the main tools, trade-offs and when to pick one.

November 17, 20269 min readBy CMS Chat Team

A Git-based CMS is a content management system that stores your website's content as files (usually Markdown, MDX, JSON or YAML) inside the site's Git repository instead of in a database. Editors get a friendly screen to change text, and every save becomes a Git commit next to the code. The site rebuilds from the repository, so content and code share one history, one review process and one place to roll back.

That one design choice explains most of the strengths and most of the limits. Here is how it works in practice, which tools exist, and when a Git-based CMS is the wrong choice.

How a Git-Based CMS Works

A traditional CMS such as WordPress keeps pages in a database and renders them on request. A headless CMS such as Contentful or Sanity also keeps content in its own hosted store and hands it to your front end through an API. A Git-based CMS skips that separate store. The content files live in the same repository as the templates and components.

The usual flow looks like this:

  1. An editor signs in to the CMS, often with a GitHub, GitLab or Bitbucket account.
  2. The CMS reads content files from the repository and shows them as forms or a visual editor.
  3. When the editor saves, the CMS writes the changed file back to the repository as a commit, either straight to the main branch or to a separate branch for review.
  4. Your hosting provider sees the new commit, rebuilds the site and publishes it.

Decap CMS (formerly Netlify CMS) describes itself as "an open source content management system for your Git workflow," with content "stored in your Git repository alongside your code." Its docs call it a React app that "acts as a wrapper for the Git workflow, using the GitHub, GitLab, or Bitbucket API." TinaCMS puts it the same way: "When users make a change in the CMS, a commit is made back to your Git repository."

The Main Git-Based CMS Tools

Each of these describes itself as Git-based on its own site. They differ mostly in how the editor looks and where the backend runs.

  • [Decap CMS](https://decapcms.org/docs/intro/): open source, form-based admin screen you add to your site. Backends include GitHub, GitLab, Bitbucket, Gitea/Forgejo and Azure. By default, its configuration docs say entries are "committed directly into the main repository branch"; setting publish_mode: editorial_workflow adds "more control over the content publishing phases."
  • [TinaCMS](https://tina.io/docs): "an open-source, Git-backed headless content management system." Content is Markdown, MDX and JSON in Git. It offers visual editing for React sites, with a hosted backend (TinaCloud) or a self-hosted one.
  • [Keystatic](https://keystatic.com/docs/introduction): works on a new site or "to introduce content management into your existing codebase." It "can save data locally, directly to Github, or both," with integration guides for Astro, Next.js and Remix.
  • [CloudCannon](https://cloudcannon.com/): a commercial product that calls itself a "Git-based CMS" with visual editing, "powered by Git and your SSG of choice." Its site lists Next.js, Eleventy, Astro, Hugo, Nuxt, Jekyll and SvelteKit, on GitHub, GitLab or Bitbucket.

All of them need some setup: a config or schema that tells the CMS which files and fields are editable.

Why Teams Choose a Git-Based CMS

One source of truth. Content and code are versioned together. A page change and the component change it depends on can ship in the same pull request.

Full history and rollback for free. Every edit is a commit with an author and a timestamp. Reverting a bad change is a Git revert, not a hunt through a database backup.

Review with the tools you already use. Because edits are commits, you can apply GitHub's protected branches to content. With required reviews, the docs say collaborators "can only push changes to a protected branch via a pull request that is approved by the required number of reviewers," and required status checks stop a broken build from merging.

No database to run. Static and server-rendered sites stay simple to host. There is no separate content service to keep online or pay for per seat.

Content stays portable. Markdown and JSON files are readable by any tool. If you switch editors later, the content does not need an export.

The Trade-Offs

A Git-based CMS is not free of cost. It moves the cost to setup and structure.

You have to model the content first. The editor only sees what the config describes. Text that is hard-coded inside a React component, an Astro layout or an HTML template is invisible until you move it into a content file and wire the component to read it. On a finished custom site, that refactor is often the largest part of the job. We walk through it in how to let clients edit a Next.js site without a CMS.

Every save is a build. Content goes live only after the site rebuilds. For a marketing site that is fine. For a news site publishing every few minutes, or content that changes per visitor, a database-backed or headless CMS fits better.

Editors still learn a dashboard. A Git-based CMS is friendlier than GitHub, but it is still an admin screen with collections, fields and a save button. Some small business owners will not log in to anything.

Large teams need more workflow. Scheduled publishing, localisation workflows, granular roles and asset pipelines are where a hosted headless CMS usually has more built in. If that is your list, read headless CMS with AI editing for how those platforms compare.

Permissions follow Git. Editors typically need an account with write access to the repository, or the CMS's own auth layer in front of it. Decide early who can push to which branch.

Git-Based CMS vs Headless CMS

The two are often grouped together because both feed a modern front end. The difference is where content lives.

  • Git-based: content is files in your repo. History, review and rollback are Git. Publishing means a rebuild. Best for marketing sites, docs and blogs built with a static site generator or a framework like Next.js, Astro or Hugo.
  • Headless (API-based): content lives in the vendor's store and is fetched through an API. Better for many channels (web, app, kiosk), large editorial teams, frequent publishing and structured content reused across products.

Neither is better in general. Pick by how often content changes, how many people edit, and how many places the content goes.

When a Git-Based CMS Is the Right Choice

  • The site is built with a static site generator or a framework that reads files at build time.
  • Content already lives in Markdown, MDX or JSON, or you are willing to move it there.
  • There are repeating collections: blog posts, team members, case studies, events.
  • A developer owns the repo and wants every content change reviewable in Git.
  • Editors are comfortable with a simple admin screen.

When Something Else Fits Better

  • The text is spread across components and you will not refactor it. A Git-based CMS cannot see it. A chat editor that reads the code, or a developer making the edit, is shorter.
  • The client changes three values twice a year. A settings file and five minutes of your time is less work than a CMS config.
  • Content must update instantly or per user. Use a database or headless CMS.
  • The client wants to design new pages. That is a page builder's job, not a content editor's.

Where CMS Chat Fits

CMS Chat works on the same principle as a Git-based CMS: the repository is the source of truth and every change is a Git commit. The difference is the interface and the setup. Instead of a config that lists editable fields, you install the CMS Chat GitHub App on the chosen repository. It detects the framework and scans the repo to map editable zones (text, images, links and prices in TSX, MDX, Markdown, HTML and JSON files), so text that still sits inside components is reachable without a content migration.

Editors type the change in plain language, and CMS Chat finds the file and makes the edit. Each zone has a guardrail: editable, warn, escalate or locked. Routine edits are committed to the default branch; riskier ones arrive as a pull request for the developer, and layout or code changes are never guessed. If you connect Google Search Console, it warns before an edit touches a title, H1 or meta description that ranks. Agencies get client portals with invites and an activity history, and developers can make the same edits from Claude, ChatGPT, Claude Code or Cursor through the MCP endpoint.

If a form-based Git CMS suits your editors and your content is already in files, use one. If the site is finished custom code and the client would rather type than learn a dashboard, see how CMS Chat works. For deciding who may edit what, our guide to content editing guardrails applies to either approach.

Frequently Asked Questions

Is a Git-based CMS the same as a static site CMS?

Mostly, but not exactly. Git-based CMSs are popular with static site generators because both read files at build time. They also work with frameworks like Next.js and Astro that render on a server, as long as the content is read from files in the repo.

Do editors need a GitHub account?

It depends on the tool and backend. Decap lists GitHub, GitLab and Bitbucket sign-in among its options, and hosted services like TinaCloud or CloudCannon add their own login layer. Check the auth docs of the tool you pick before you invite non-technical editors.

Can a Git-based CMS edit text inside React or Astro components?

Not by itself. It edits the content files its config describes. Text hard-coded in components has to be moved into a content file first, or edited by something that reads the code directly.

What happens if an editor makes a mistake?

Because each save is a commit, you can revert it in Git. With branch protection and a review workflow, the mistake can be caught in a pull request before it reaches the live site.

Change your site by asking.

Sign up, connect your site and ask for your first change in plain words.

month to monthrevert any changebigger work stays with your agency

Prefer to see it first? Ask for a walkthrough