Repositories that use Git LFS
Setting one up, its large files on the way to and from the server, and the space they take on your Mac.
Git LFS keeps large files out of a repository’s history. What is committed is
a small pointer; the file itself is stored on the remote’s LFS server, and the
git-lfs tool moves it between the server and your Mac. A repository that
uses Git LFS opens, clones, pulls, switches branch, commits and pushes in
Innesta like any other, after one confirmation at most.
git-lfs
Innesta uses your own git-lfs, 3.5.0 or later, if you have one — from Homebrew, for instance. Otherwise it offers to install one: from the Git LFS card in General settings, with Install Git LFS…, or the first time something needs it. It downloads the release it is pinned to from GitHub and checks its checksum and GitHub’s code signature before using it. That copy is for Innesta only: Terminal and other apps need their own.
Use Git LFS, in the same card, turns Git LFS off. Innesta then runs no git-lfs of its own accord.
Setting a repository up
Innesta recognises a repository that uses Git LFS by the .gitattributes at
its root. Setting it up is git lfs install --local, which writes to the
repository’s own configuration and hooks, never to your ~/.gitconfig.
With git-lfs available, Innesta does that in the background when you open the repository. Otherwise the working copy opens with a notice, This repository uses Git LFS. Set Up Git LFS asks to install git-lfs if there is none, then sets the repository up and downloads its large files; Not Now hides the notice in this repository.
Downloading
With git-lfs available, a clone opens as soon as Git has the history, and the large files download afterwards, with their progress in the working copy’s notice and Cancel beside it. Cancelling keeps the clone. Without git-lfs, the clone opens with pointers in their place, and the notice offers to set it up.
When large files are still missing from this Mac — after a download that was cancelled or failed, say — the notice counts them and offers Download.
Pushing
With git-lfs available and Git LFS on, Innesta uploads the large files of a
push before the push itself. A pre-push hook that belongs to another tool,
such as husky, does not call git-lfs, so this is what keeps those files from
being left behind; the repository’s settings warn that pushes from Terminal
need git lfs pre-push in that hook.
Progress and errors
A transfer shows its direction and how much has moved in the status bar. When one fails, the message names the cause: the host’s Git LFS quota used up, no access to the large files, commits someone pushed without their large files, a file over GitHub’s 100 MB limit, or a full disk. Where there is something to do, the message offers it: Set Up Git LFS, Download or Free Up Space….
The repository’s settings
Repository ▸ Repository Settings… has a Git LFS section in every repository:
- Status — off, not used, set up or not set up, with Set Up Git LFS or Turn On Git LFS where the repository uses Git LFS.
- Tracked Patterns — the patterns of the root
.gitattributesthat store files in Git LFS, and Add Pattern; see Git LFS files. - Storage, where the repository uses Git LFS — On This Mac, the space its large files take, and Free Up Space….
Freeing up space
Free Up Space… removes from this Mac the large files the remote is confirmed to have, after asking; they are downloaded again when needed. A file the server cannot vouch for stays, and so does every file when the server cannot be reached. It needs a remote on a server, not a folder.
Not in Innesta
File locking, and git lfs migrate, which rewrites history to move files into
Git LFS, are command-line work.
A repository whose Git LFS patterns are all in .gitattributes files in
subfolders, with none of its large files on this Mac, is not recognised as one
that uses Git LFS unless Innesta cloned it. Its diffs still offer
Download.