LinuxCommandLibrary

git-lfs-transfer

Transfer large Git LFS files

TLDR

Upload large files tracked by Git LFS to a repository

$ git-lfs-transfer [path/to/repo.git] upload
copy

Download large files tracked by Git LFS from a repository
$ git-lfs-transfer [path/to/repo.git] download
copy

SYNOPSIS

git-lfs-transfer download|upload|check [options] <oid> [<oid> …]

PARAMETERS

--background[=<n>]
    Perform concurrent transfers with optional thread count n (default: 3)

--dry-run
    Simulate transfers without actual I/O

--to=<url|remote>
    Upload/download to/from specific endpoint or Git remote

--from=<url|remote>
    Download from specific endpoint or Git remote

--include=<glob> […]
    Include objects matching path globs

--exclude=<glob> […]
    Exclude objects matching path globs

--all
    Operate on all relevant objects (implies download/upload)

--debug
    Enable verbose debug logging

--no-verify
    Skip integrity checks (use cautiously)

DESCRIPTION

The git-lfs-transfer command is the core transfer agent in Git Large File Storage (LFS), handling the protocol for downloading, uploading, and verifying large file objects (identified by SHA256 OIDs) between a local Git repository and an LFS-compatible server.

It operates as a backend for higher-level Git LFS commands like git lfs pull, git lfs push, and git lfs fetch, but can be invoked directly for precise control over object transfers. Supported actions include download (fetch missing objects), upload (send local objects), and check (verify server availability).

Key features encompass concurrent background transfers for efficiency, dry-run mode for testing, remote-specific targeting, and glob-based inclusion/exclusion for selective operations. It relies on Git config settings like lfs.url or environment variables for endpoints. This enables seamless management of large binaries (e.g., images, videos, datasets) in Git workflows, keeping repositories lightweight via pointer files.

CAVEATS

Requires Git LFS ≥2.0 and configured lfs.url; concurrent transfers may strain servers; OIDs must be valid SHA256 hashes; not for direct file path use (use git lfs ls-files to find OIDs).

EXAMPLES

git-lfs-transfer download abc123...
git-lfs-transfer upload --background --to=origin def456...
git-lfs-transfer check --all

CONFIGURATION

Set via git config lfs.transfer.adapter for custom agents; env vars like GIT_LFS_SKIP_SMUDGE=1 bypass indirect calls.

HISTORY

Introduced in Git LFS v1.0 (2015) by GitHub/Microsoft as default agent; enhanced in v2.x+ with concurrency, custom endpoints, and protocol v2 support for better performance.

SEE ALSO

git-lfs(1), git-lfs-fetch(1), git-lfs-push(1), git-config(1)

Copied to clipboard