# Version control

Putting Zene Studio projects in git, why it is worth it, and how to keep diffs readable.

Source: https://zenestudio.org/docs/files/version-control

Markdown version of the Zene Studio page at https://zenestudio.org/docs/files/version-control. For a map of the whole site, see
https://zenestudio.org/llms.txt.

---
A Zene Studio project is XML, which means it works with **git** properly. Git sees a file you can
diff, review and merge, not an opaque binary blob.

For an alpha whose file format is not yet stable, this is not a nice-to-have. It is the answer to
"what if I break something".

## The basics

```bash
mkdir my-song && cd my-song
git init

# .mmpz (compressed) is a single artifact — one file per commit.
# .mmp (uncompressed) gives readable diffs line by line.
cp ~/Music/my-song.mmp ./my-song.mmp

git add my-song.mmp
git commit -m "First arrangement"
```

Work on a branch, commit when something works:

```bash
git switch -c drums-pass
# ... work in Zene Studio, save ...
git commit -am "Tighten the kick timing"
```

When a version sounds good, **tag it**:

```bash
git tag mix-approved-v3
```

Now you can always get that exact state back, forever.

## `.mmp` or `.mmpz`?

| | `.mmp` | `.mmpz` |
| --- | --- | --- |
| Diff | Readable line by line | Opaque — one blob per save |
| Size | Larger | Smaller |
| Best for | Projects under active collaboration or review | Final archival snapshots |

A practical arrangement: work in `.mmp` while the project is moving, then save a `.mmpz` for the
versions you care about keeping.

:::note
If you commit `.mmpz`, Git sees every save as a completely different file. The history is still
there and you can always go back — you just cannot see *what changed*. That is usually fine for
archives and painful for review.
:::

## Ignoring noise

Zene Studio may write autosave and recovery files next to your project. Those should not be
committed. A `.gitignore`:

```ini
# Autosave and recovery files
*.autosave
*.mmp.tmp
*.mmpz.tmp
```

Autosave recovery is gated on the file belonging to the project and being newer than it, so a stale
recovery file will not strand you at a prompt — but it is still noise in a repository.

## Collaborating

Because the format is text, the usual git workflow applies:

1. **One person edits at a time.** Two people saving the same `.mmp` concurrently will conflict on
   every change, because the whole project is one file.
2. **Merge conflicts in a project are not line-mergeable** in any useful sense. Coordinate rather
   than trying to resolve them.
3. **Branch per idea**, so musical disagreements happen in branches, not in the same file.

## Backups are not the same as history

Git is excellent at history and fine at backups. For "the disk died" you still want a copy somewhere
else. Push to a remote — private if the project is not finished.