Git extension for managing large files by storing them outside the repository and tracking pointers
Git LFS (Large File Storage) is a command-line extension that manages large files in Git repositories by storing the actual file content in a separate location while keeping lightweight pointer files in the Git repository. Written in Go, it provides pre-compiled binaries for Mac, Windows, Linux, and FreeBSD and integrates directly with Git workflows.
The tool works by tracking specified file patterns using git lfs track "*.psd" commands, then handling the storage and retrieval of large files automatically during normal Git operations like add, commit, and push. When files are pushed, Git LFS uploads the large file content to the LFS server while Git tracks only small pointer files. This approach keeps repository sizes manageable while maintaining version control for large assets.
Git LFS supports migration of existing large files in repository history through git lfs migrate commands, which can either import files to LFS storage or export them back to regular Git storage. The tool includes commands for listing tracked files (git lfs ls-files), viewing environment information (git lfs env), and comprehensive help documentation. It requires a one-time global configuration via git lfs install and works with Git versions as early as 2.0.0, though recent Git versions are recommended for optimal performance.
# via Homebrew
brew install git-lfs
# via Mise
mise use --global git-lfs@latest