# Version Control

## Dev, Production and Session Repositories

Mprove files:

- [mprove.yml](/content/docs/reference/project-config) (Project Config)
- [\*.malloy](/content/docs/reference/model-malloy)
- [\*.store](/content/docs/reference/model-store)
- [\*.chart](/content/docs/reference/chart)
- [\*.report](/content/docs/reference/report)
- [\*.dashboard](/content/docs/reference/dashboard)

Each project has 3 types of repositories that are local to mprove server:

- **Production** - repository that mirrors **Remote** repository content
- **Dev** - personal repository for each project member with **FilesEditor** role
- **Session** - separate repository for each session of type Editor

Dev repositories allow users to edit files and test changes without affecting **Production** version of files.

Users with **FilesEditor** role can manually edit files in their personal Dev repositories.

<Callout type="info">
  To be able to edit files, a user with the **FilesEditor** role must select the
  **Dev** repository in the navigation bar.
</Callout>

When user makes a manual change to any file, Mprove does the following:

- Validates all files
- Shows validation errors (if any)
- Updates Models, Charts, Dashboards and Reports structure that have passed validation

Once the user is satisfied with the changes made, the user can **_commit_** and **_push (deploy)_** changes to **Production** repository to share results with the team.

<Callout type="info">
  When changes are pushed to **Production**, they are actually pushed to
  **Remote** first, and then pulled from **Remote** to **Production**. In other
  words, changes from the **Dev** repository are pushed to the **Production**
  repository via the **Remote** repository in a single user action.
</Callout>

## Git Branches

Small projects may only need to use one branch (usually called master or main). Advanced git users may work in different branches.

<Callout type="info">
  Users can switch between branches using **repo-branch** selector in navigation bar.
</Callout>

## User Actions

Git related actions are available on the Files page:

- **Save and Validate** - Save the changes. Mprove will automatically check all files in the project repository data folder for errors.

<Callout type="warn">
  If errors are found during files validation step, they need to be fixed before pushing to production.
</Callout>

- **Commit** - Commit changes in Dev repo.
- **Push** - Deploy committed changes from Dev repo to Production repo (and to Remote repo).
- **Revert to Last Commit** - Discard saved changes in Dev repo that were not committed.
- **Revert to Production** - Revert all changes in the Dev repo to the current Production version of files.
- **Pull from Remote** - Fetch changes from Remote repo branch and merge into the selected repo branch.
- **Merge branch** - Merge changes from another branch into the current branch.
- **Create branch** - Create a new branch.
- **Delete branch** - Delete current branch.
