Skip to content
GitTree
Stashes and worktrees

Use Git LFS controls

Git LFS stores large files, such as images, videos or models, outside the repository and keeps small pointer files in their place. Git LFS… sets it up, tracks patterns, downloads content, locks files and prunes old content.

FreeUpdated

Works in GitTree Free: every local Git feature, once you are signed in.

On this page
  1. Before you start
  2. Where to find it
  3. Steps
  4. Expected result
  5. Locks and pruning
  6. If something goes wrong
  7. Questions
  8. Related

Before you start

  • The git-lfs program is installed: Homebrew or git-lfs.com on macOS, included with Git for Windows, sudo apt install git-lfs on Linux (Ubuntu and Debian).

Where to find it

  • The command palette: Git LFS… and Git LFS: Download Content.
ActionmacOSWindows and Linux
The command palette, then Git LFS…⌘⇧PCtrl+Shift+P

Steps

  1. Set it up

    Open Git LFS…. If it says Git LFS is not set up for this repository., choose Set Up for This Repository.

  2. Track a pattern

    Under Tracked patterns, type a Pattern such as *.psd and press Track. Turn on Lockable for files people should not edit at the same time. Commit .gitattributes.

  3. Download content

    Choose Download Content to fetch the real files for pointers in your checkout. Show Files lists which are downloaded or pointer only.

Expected result

Large files go to LFS storage on push, and your clone holds only what you download.

Locks and pruning

  • Show Locks lists locked files and who holds them; Lock a file before editing it, Unlock when done.
  • Prune Old Content… removes local copies of old LFS content to free disk space; it shows what it would remove first.

If something goes wrong

“Git LFS is not installed.”

Install git-lfs as the message describes for your system, then reopen the dialog.

Questions

Does tracking a pattern move files already committed?

No. Tracking applies to files you add or change from then on; moving existing history into LFS needs a history rewrite outside GitTree.