Skip to content

Large files

Git copes badly with big files that cannot be combined: every version of a model, a map or a recording stays in everyone’s copy of the project for good. So Saturn keeps those with Git LFS. Git itself holds a few lines that name the file’s content, and the content is kept beside the project, on GitHub and on each computer. In the folder, the file is the file, as always.

There is nothing to type:

saturn save "Add the town"
• assets/Town.rbxl is 29 MB, so every .rbxl file is kept as a large file from now on.
.gitattributes says so, and is saved along with it.
✓ Saved "Add the town" (2 files)

Everyone working on a project with large files needs the git-lfs program installed, once. Nothing else has to be set up: nobody runs git lfs install. On a computer without it, Saturn stops and gives the command that installs it.

Computer How
Windows Comes with Git for Windows
Mac brew install git-lfs
Linux In the system’s packages

A file that a save adds or changes becomes a large file when it is over 1 MB and cannot be combined: a kind of file Saturn knows by its ending, or any file that is not text. Text stays in git, however long it is.

.gitattributes is the list of them, in Git LFS’s own words, so a project that was on Git LFS before needs no changing. Where the project has no other file with that ending, the line covers every file with it: *.rbxl. Where it has, the line names that one file, and the others stay as they are until a change takes one of them past 1 MB.

To keep a kind of file out, give it -filter there: *.mp3 -filter.

A large file cannot be combined, so it is held by the work that changes it, like any model. When two people change one all the same, save stops with both versions whole: pick one with --keep, or put the file you want in its place.

  • save and ship send a file’s content to GitHub before the work that names it, and say so when they cannot. The work is then not sent either: nobody is ever handed a file whose content is missing.
  • Bringing in a teammate’s work downloads the content of the large files it changed. If that fails, the save still finishes, and says which files could not be opened yet. The next save that reaches GitHub gets them. ship waits until they are there, since the project’s checks would otherwise be looking at a placeholder.
  • A download or upload says how far it has got while it runs. An agent is told nothing until it is over.
  • With nobody at the keyboard, a download or upload is given up on after 30 minutes, and what it got through is kept.

A new file over 50 MB is still questioned before it is saved, unless it is a large file. GitHub keeps up to 2 GB for one large file, and a bigger one is refused the same way.

Each large file is on the computer twice, in the folder and in .git/lfs, except on disks that can share the bytes between two files (APFS, Btrfs, XFS). Older versions stay in .git/lfs until git lfs prune clears them. Nothing downloads only part of a project: every large file the game has is in every folder.

  • Other git tools see a project’s large files properly only where git lfs install has been run. Without it, an editor’s git panel may show large files as changed, and a commit made there puts them into git whole. The next saturn save moves them over, but they stay in the project’s history.
  • A file that a project’s own .gitattributes marks lockable is made read-only by Git LFS’s hooks when plain git commits, merges or switches in a folder where large files have been saved. Saturn’s own commands never do that, and do not undo it.
  • A server that builds the game has to fetch large files too. On GitHub Actions that is lfs: true on the checkout step.