Skip to content

ajskateboarder/scratch-git

Repository files navigation

scratch.git

Git version control integration for Scratch (TurboWarp) that just works and makes sense

scratch-git-preview.mp4

The goals of this interface is to:

  • teach children about code versioning through a dead-simple interface
  • make it easier to track changes
  • make collaboration efficient, relying less on remixing

scratch.git works by modifying TurboWarp Desktop through a userscript. Git interfacing is done between the desktop GUI and the local computer through a WebSocket interface between the userscript and a small server.

Usage

  1. Install these things:

(For development, you'll need a recent version of Node.js to compile the userscript and Rust to compile the server)

  1. Download the scratch.git release for your system from the Releases section

  2. Unpack the zip or tar.gz and run the scratch.git executable - it'll run continuously until you close out the terminal or do Ctrl+C

Currently, scratch.git releases are only made for 64-bit Windows, MacOS, and recent Linux versions such as Ubuntu 20.04. Other systems will need to build from scratch for now - contributions for other systems are greatly appreciated!

Congrats, you are now a 🦄✨~ 1000x developer ~✨🦄, no Git skills required!!

You should now see:

  • a welcome dialog to set up a project with scratch.git

  • a Git menu to view commits, configure an online repository on GitHub/GitLab/etc, and push the current commits

  • diff indicators that show up next to your sprites and stage when you save the project. These will show differences between the code before and after you save.

These features closely mimic the kind of Git development seen in editors such as Visual Studio or VS Code, but in a more friendly manner.

Developing

Install the build dependencies:

npm install

And run the debug script (Linux only for now):

.vscode/debug.sh

Alternatively, if you are using VSCode, there is a build task you can configure to run with Ctrl+Shift+B.

Commit specification

scratch-git uses a derivative of Convential Commits which has been adapted to fit Scratch programming.

Changes are done by sprite and are separated by commas.

Commits start with the name of the sprite you are making changes to (e.g. Sprite1, Stage) with a colon afterwards (similar to CC).

Commits then specify the change they are making using one of the following statements:

Statement Description
add [costumes] The following costumes: [costumes] have been added
remove [costumes] The following costumes: [costumes] have been removed
modify [costumes] The following costumes: [costumes] have been edited
{+|-|/}{blocks} blocks {blocks} number of blocks have been added (+), removed (-), or rewritten (/)

Commit examples

Sprite1: +3 blocks, add costume1, Stage: remove backdrop3
Ball: /12 blocks, add red-ball, Stage: add matrix
Player: +36 blocks, remove old-player, Cloud: +15 blocks

Credits

Thanks to: