The git extension (git-sb3)
git-sb3
makes version-controlling Scratch .sb3 projects actually work. Installed on
your PATH as git-sb3, git discovers it as a subcommand — so every command
runs as git sb3 <command>.
An .sb3 is a zip wrapping a single-line project.json
plus its costume and sound assets. To git it's an opaque binary blob, so every
commit just says "Binary files differ" — useless for review, blame, or
merge. git-sb3 turns that into a real diff.
What it does
git diffbecomes readable. Atextconvdriver renders each project as text — scripts as scratchblocks, plus variables, lists, costumes and sounds — so a commit's real effect shows up line by line.- Visual diffs.
git sb3 diffproduces a self-contained HTML report that renders scripts as real scratchblocks SVGs, tinting added scripts green, removed scripts red, and showing modified scripts old-vs-new with a precise block-level text diff. - Live diffs.
git sb3 watchserves that report and refreshes it as you edit — on file save, or in real time from the TurboWarp userscript over WebSockets. - Diffable working trees.
unpackexplodes an sb3 into a pretty-printed, line-diffable tree (andpackputs it back), if you'd rather commit the expanded form.
How it pairs with scratch4js
git-sb3 reads .sb3 zips with the same @turbowarp/jszip
foundation as scratch4js, reconstructs each target's blocks
into scratchblocks source with
parse-sb3-blocks, and renders
them headlessly with scratchblocks. Where
scratch4js edits a project and the scratch-mcp server lets
an agent author one, git-sb3 makes the project's history reviewable.
In this section
- Getting started — install, then wire the readable diff driver into a repo.
- Commands —
install,text,diff,unpackandpack, with every option. - Visual diffs — the scratchblocks HTML report and how it's rendered.
- Live diffs —
git sb3 watchand live refresh from the TurboWarp userscript.
In a repo with .sb3 files: git sb3 install wires up readable git diff, and
git sb3 diff game.sb3 writes an HTML report of your uncommitted changes.
Scope
git-sb3 is a Node CLI (Node 18+) and needs git on your PATH. It renders
block scripts, variables / lists / broadcasts, and costume / sound
changes. It does not attempt a three-way merge driver — its focus is making
diffs and history reviewable.