Overview

Mage has file versioning built-in— that means you don’t need to configure Git to roll-back changes or recover old file versions.

Any update to the contents of a file will create a new version that can be used to restore a file to a previous state. This also includes changes to a pipeline.

Configure the number of versions per file

You can set how many previous versions to keep track of for every file.

Set the following environment variable name and value:

NameMAX_NUMBER_OF_FILE_VERSIONS
ValueAny integer value.
Default100

Where are the file versions stored?

Each file version is stored in the following directory:

[project_name]/.file_versions

For example, if your project name is demo_project, then the directory will be demo_project/.file_versions.

Please add .file_versions to your .gitignore file. For more information, please read the project setup guide.

How to view file versions

For Mage versions <0.9.58

  1. Open a pipeline.
  2. Edit the pipeline.
  3. In the file browser on the left side of the page, click on a file.
  4. Near the top on the right side, click the button Show versions.
  5. A list of previous versions for that file will appear in the right side panel.

File versions

For Mage versions >=0.9.58

  1. Go to the project Files page (located at /files).
  2. In the file browser on the left side of the page, click on a file.
  3. In the middle section header above the file editor, click Show file versions.
  4. A list of previous versions for that file will appear in the right side panel.

How to restore to a previous version

  1. In the right side panel, click on a previous version.
  2. Click the button labeled Replace with this version.
  3. The contents of the file will be updated with the contents from the previous version.