Versioning

Headcode CMS includes a simple but powerful versioning system.

It lets you clone all content from an existing version, make changes safely, and prepare new content for an upcoming release, campaign, or website update.

When combined with Vercel preview deployments, each version can even have its own public preview URL, making it easy for teams to review and approve new content before publishing.

1. How Versioning Works

A Headcode CMS version contains all entries and their sections.

When you create a new version and clone it from a previous one, all data, entries, sections, and fields, are duplicated.

Each version is defined in your headcode.config.ts file:

headcode.config.ts
export const headcodeConfig: HeadcodeConfig = {  version: 'v02',  clone: 'v01',  entries: [...],};

In this example, a new version v02 is created by cloning everything from version v01.

2. Database Structure

Each entry in the database tracks which version it belongs to.

The entries table includes:

  • id

  • version

  • namespace

  • key

3. Typical Versioning Workflow

  1. Create a new Git branch for the new version

  2. Update your headcode.config.ts to set the new version and clone from the previous one (e.g., version: v02, clone: v01)

  3. Push the branch to GitHub. Vercel will automatically create a new preview deployment with its own public URL

  4. Open the Headcode Admin in that preview deployment, you’ll be prompted to clone the content from the previous version

  5. Edit and prepare the new content in the Admin interface

  6. Review the preview site and verify everything looks good

  7. Merge the branch into main, this triggers a new production deployment

  8. Your new version is now live

4. Summary

Versioning in Headcode CMS is designed to match real‑world workflows.

It integrates naturally with Git, Vercel, and modern frontend development, giving you a repeatable, safe process for launching new content versions without disrupting your live site.