# How it works

A site's content lives in its GitHub repository: Markdown, JSON or YAML files, plus images and documents. SP CMS edits those files, and the site's usual build publishes them.

## Branches and configuration

A project in SP CMS is one GitHub repository. You work on one branch at a time, and each branch has its own `.pages.yml`, so a configuration change can be tried on a branch before it's merged.

`.pages.yml` describes files that already exist: which ones are editable, their fields, and where media goes. It doesn't change how the site is built. See [configuration](/configuration/).

## Saving

- **Drafts.** Unsaved changes stay in the editor's browser, so closing a tab doesn't lose work. Nobody else sees them.
- **Saves.** Each save is one commit to the current branch.
- **Conflicts.** If someone else changed the file since it was opened, SP CMS shows both versions field by field and the editor chooses before saving. Nothing is overwritten.
- **Rules.** Content with fields is always saved through its form, so the rules in `.pages.yml`, such as `required` and `pattern`, are checked on every save.

## Publishing

SP CMS commits; it doesn't deploy. Seymourpowell's sites rebuild on every push to `main`, so a save goes live a minute or so later, when that build finishes. To build on demand instead, add an [action](/configuration/actions/).

The site's own build is the final check on content. Its schema should reject anything the page can't use, so a mistake made outside SP CMS can't reach the live site.

## People

- **The Seymourpowell team** sign in with GitHub and use their own access to the repository. With write access they can edit, change the configuration, invite people and run actions.
- **Collaborators** are invited by email and need no GitHub account. They can edit the content and media that `.pages.yml` exposes and run its configured actions. Their saves are committed through the `seymourpowell-cms` GitHub App. See [invite collaborators](/guides/collaborators/).

## Caching

SP CMS keeps a cache of file listings and content from GitHub. GitHub's webhooks keep it current on every push, and SP CMS rechecks it from time to time; GitHub always holds the real data. If something looks out of date, enable [`settings.cache`](/configuration/settings/) and clear it from the **Cache** page.
