Back to Guides
GuidePublished January 18, 20267 min read

Versioning in RunMat

How RunMat automatically versions files, captures project snapshots, restores prior states, and exports history to git-compatible timelines.

RunMat records file history when you save or write files in a cloud project. Each version records who changed the file, when, and its content hash. The retention policy below determines which file versions are kept.

With live collaboration enabled, text edits sync as you type and are stored by the project service. Save records a file version in history. See Collaboration and Sync & Local Cache.

This page covers how versioning works, how snapshots let you capture and restore project state, and how to export your history to git when you need it.


How it works

Automatic file versions

Every file write in a RunMat project creates a version record with:

  • The content hash of the file
  • File size
  • Who made the change (actor)
  • Timestamp

Version records are created by the project filesystem when it accepts a write.

What gets versioned

The versioning policy depends on file type and size:

  • Code and config files (.m, .py, .rs, .json, .yaml, .toml, .md, .txt) are always versioned.
  • Large files above the size threshold (default: 50 MB) are only versioned if they match the extension allowlist.
  • Dataset manifests are always versioned, regardless of size -- so you get full lineage on large datasets without storing duplicate copies of the data itself.

Retention settings determine how long those versions remain available.

Viewing history

From the desktop app, open any file and view its version history in the sidebar.

Restoring a previous version

Pick a version from the timeline and review the restore. The restore creates a new current version and preserves earlier history. In an active collaborative document, the operation checks the state you reviewed; intervening edits can require another review. Pending local work is retained for recovery rather than replayed over the restored document.


Snapshots

Snapshots capture the entire project at a point in time -- every file, every path, pinned to specific versions. Think of them as save states for your whole project.

Creating a snapshot

One action captures the full project tree. You can add a message to describe what the snapshot represents.

From the desktop app, click Snapshot in the project toolbar.

Restoring a snapshot

Restoring a snapshot makes its file versions the current project state and records the restore in history. Review the affected files before confirming. In a collaborative project, accepted text is preserved before replacement and old pending edits are kept for recovery; clients reconcile with the new state.

How snapshots protect your history

You can configure RunMat to prune old file versions per project. Versions referenced by a retained snapshot are excluded from pruning.

Snapshot chain

Snapshots form a linear chain, with each snapshot pointing to its parent.

Loading diagram...

Git export

Snapshots can be exported as a git-compatible history. Each snapshot becomes a git commit. Snapshot tags become git tags.

This is useful when you need to:

  • Hand off an audit trail to a reviewer who expects git
  • Archive a project in a git repository
  • Interface with CI/CD systems that consume git

You can export history to git without using git for daily editing.

Git sync (two-way)

For teams that want git as a secondary record, RunMat supports two-way sync on a single linear branch (refs/heads/main):

  • Push to git: Upload streams your snapshot chain as a git fast-import.
  • Pull from git: Receive accepts a git fast-import for linear history.

Non-fast-forward updates are rejected to keep the history clean.


Versioning for large datasets

Scientific projects often include files that are gigabytes or larger. RunMat handles this with sharded files: your large dataset is split into shards, and a manifest at the original path records their order and location.

RunMat versions the manifest, not the shards. When your dataset changes, only the affected shards are rewritten. The manifest gets a new version pointing to the updated shard list. You get full dataset history -- which shards changed, when, by whom -- without duplicating terabytes of data on every update.


Automation & Headless Usage

RunMat is designed to run in CI/CD pipelines and headless environments. You can perform all versioning actions via the API.

File history

GET /v1/projects/{projectId}/history?path=/analysis/main.m

Restore file version

POST /v1/projects/{projectId}/history/restore
{ "versionId": "ver_abc123" }

Create snapshot

POST /v1/projects/{projectId}/fs/snapshots
{ "message": "Before parameter sweep" }

Restore snapshot

POST /v1/projects/{projectId}/fs/snapshots/{snapshotId}/restore

Export to git

GET /v1/projects/{projectId}/fs/snapshots/{snapshotId}/git-export

Configure retention

POST /v1/projects/{projectId}/fs/retention
{ "maxVersions": 50 }

Retention and cleanup

By default, RunMat keeps unlimited version history. For projects where storage matters, you can configure a maximum version count per project.

Rules:

  • When the limit is reached, the oldest versions are pruned first.
  • Versions referenced by snapshots are never pruned.
  • Setting maxVersions to 0 disables pruning (unlimited history).

Offline use

A cloud project needs a connection for synchronization and shared run input capture. Cached files and pending edits can remain on your device during a disconnect; see Sync & Local Cache for what is available offline.

A private Server deployment can operate on an internal network with its own database and storage. Clients still need a connection to that server.