# Version Control

Once you've moved beyond the simplest of projects, you will find that version control becomes an important part of your application development process. Version Control is a catch-all term for a system that performs the following functions

- Allows you to turn back time to a previous version of your code and assets
- Allows you to see changes that have been made to a project over time
- Allows you to trial new changes in a safe place, isolated from other developers, and merge changes when ready

PlayCanvas has version control tools built directly into the Editor which can be broken down into three main features. **Checkpoints** are a snapshot of your project at a single point in time, they form a timeline of changes to your project; **Branches** are a single line of development perhaps representing the changes required to create one feature or by one developer. Changes to assets in one branch will not affect changes in another branch; **Merging & Resolving conflicts**, merging is the process of combining one branch into another branch, conflicts occur when both branches edit the same data. After resolving conflicts the destination branch should contain the changes from both branches.

## Version Control in PlayCanvas

You may be familiar with other version control systems (VCS), if so this summary will help you get familiar with how PlayCanvas works relative to other version control systems.

You can think of a checkpoint like you would a **commit** in a VCS like Git or Mercurial. Each checkpoint is a point-in-time snapshot of the project with an associated message that describes what changes were made in this checkpoint. While you are editing your project your current (un-checkpointed) changes are similar to the **working directory** i.e. you can think of these as your **local changes** (even though in PlayCanvas your local changes are shared with anyone else in the same branch as you).

:::ai
Before an AI assistant changes multiple scenes or assets, use the **[Editor MCP Server](https://developer.playcanvas.com/user-manual/editor/mcp-server.md)** to checkpoint a dedicated branch. Afterwards, ask it to summarize the diff and conflicts; separately approve any restore, hard reset, or branch deletion.
:::

You cannot delete a checkpoint, but you can restore a previous checkpoint. Restoring a checkpoint works a little like a `git checkout <commit>` or `hg update -r <commit>`. However, in PlayCanvas we don't allow branches unless they have been explicitly created (no detached heads or similar). When you restore a previous checkpoint future changes will be children of the latest checkpoint in the branch.

**Branches** in PlayCanvas work like branches in other systems. A branch forms an isolated line of development made up of checkpoints. All users who have set a branch as their current branch will see their changes in a real-time collaborative fashion. When you are finished working on a branch, you can *close* it. Branches can only be deleted in [limited cases](https://developer.playcanvas.com/user-manual/editor/version-control/branches.md#deleting-a-branch).

Merging works in a similar way to other VCSs. However, in PlayCanvas it's important to note that merging occurs *between checkpoints* so any changes that you have not committed in a checkpoint will not be included in your merge. PlayCanvas automatically creates checkpoints in the destination branch of a merge to prevent you accidentally losing changes when merging.

More details can be found on the specific pages for [checkpoints](https://developer.playcanvas.com/user-manual/editor/version-control/checkpoints.md), [branches](https://developer.playcanvas.com/user-manual/editor/version-control/branches.md), and [merging](https://developer.playcanvas.com/user-manual/editor/version-control/merging.md).

## How Version Control Affects Your Storage

Using Version Control will use more storage for checkpoints and branches.

Every checkpoint created only stores the changes from the previous checkpoint. The amount of data used depends on the changes, such as new assets or replaced textures.

Creating a branch from a checkpoint makes a copy of the project's assets at that checkpoint. Every open branch counts its full copy towards your storage allowance, even if its files are identical to those in other branches. A project with many open branches can therefore use several times the storage of its assets alone.

To reduce the storage used by version control:

- [Close branches](https://developer.playcanvas.com/user-manual/editor/version-control/branches.md#closing-a-branch) you are no longer working on. Closing a branch removes its copy of the assets from your storage usage, while keeping its checkpoints. If you reopen the branch later, its assets count towards your usage again.
- [Delete a branch](https://developer.playcanvas.com/user-manual/editor/version-control/branches.md#deleting-a-branch) to remove both its assets and its checkpoints. This is only possible for branches that haven't been merged into another branch, and can't be undone.
- [Hard reset to a checkpoint](https://developer.playcanvas.com/user-manual/editor/version-control/checkpoints.md#hard-reset-to-a-checkpoint) to delete the checkpoints after it. This also can't be undone.

Other checkpoints can't be deleted, so the storage they use stays in your project's history.

If you need more storage space, please email us at [support@playcanvas.com](mailto:support@playcanvas.com). In most cases, we can increase your storage allowance with no extra charge.
