Keeping Workbook Versions in Git
You can keep a history of a workbook outside Astrato by exporting its versions as .astx archives
and committing them to a Git repository on any host. To bring a stored version back, import its
archive.
An .astx archive is a zip file. Its entries are JSON files without a file extension, such as
metadata, sheets and actions, so an unzip tool unpacks it and Git can show which files changed
between two exports.
Export a version
Section titled “Export a version”Export the version from the Library: open the workbook’s menu (⋮), select Properties and follow Export a Workbook, which covers the permission you need, what the archive holds and what to do if the export fails.
Commit the archive and its contents
Section titled “Commit the archive and its contents”Commit the .astx file itself, which is what you import later, and its unpacked files next to it,
which make the changes readable. The example keeps one workbook under workbooks/ and replaces the
previous export each time, so Git records files that were added, changed or removed:
#!/usr/bin/env bash# Save as export-workbook.sh and run it from the root of your repository:# bash export-workbook.sh# Replace the paths with your own. The script stops at the first command that fails.set -emkdir -p workbooks# Replaces the .astx file and deletes the unpacked folder: uncommitted edits in it are lost.cp ~/Downloads/"Revenue report.astx" workbooks/revenue-report.astxrm -rf workbooks/revenue-reportunzip -q workbooks/revenue-report.astx -d workbooks/revenue-reportfiles=(workbooks/revenue-report.astx workbooks/revenue-report)git add "${files[@]}"# Commit only this workbook's files, and only if the export differs from the last one.git diff --cached --quiet -- "${files[@]}" || git commit -m "Revenue report: published version, exported 2026-11-10" -- "${files[@]}"git pushThe downloaded file is named after the workbook, not the version, so name the version in the
commit message. If nothing changed since the last export, the script makes no commit. git push
still sends any earlier commits on the branch that you had not pushed.
Bring a stored version back
Section titled “Bring a stored version back”git restore overwrites the .astx file in your working tree, so run the export script first if
you have downloaded a new export. The committed file is then the latest export. To import an
earlier version, find its commit and restore that archive:
git log --oneline -- workbooks/revenue-report.astxgit restore --source <commit> workbooks/revenue-report.astxReplace <commit> with a commit from the list. After the import, run
git restore workbooks/revenue-report.astx to put the latest export back.
To import a committed archive, open the Library, select Create and, under Import,
select Workbook, then choose the .astx file and a data connection.
Importing a workbook covers each step, the choice between a new and an
existing semantic layer, and what to do if the import fails.
Importing always creates a new workbook. It does not replace the workbook you exported from, and importing the same archive twice creates two copies. To put a previously published version of the same workbook live again, use Rollback on its Versions tab instead; see Roll back to a previously published version.
Import the .astx file as you exported it. These steps do not cover rebuilding an archive from
edited JSON files.