This Git LFS error occurs when an LFS pointer file exists in your repository, but the actual binary file was never uploaded to the LFS server. The fix usually involves having the original author push the missing objects or recovering them during repository migration.
When you clone, pull, or checkout a repository that uses Git Large File Storage (LFS), Git LFS attempts to download large binary files from a separate LFS server. The repository contains "pointer files" that reference the actual content stored on the LFS server by its SHA-256 hash. This 404 error occurs when Git LFS finds a pointer file but cannot locate the corresponding binary object on the server. This typically happens because: 1. **The file was never properly uploaded** - The original contributor may not have had `git lfs install` configured, which means the pre-push hook that uploads LFS objects was not active. The pointer file got committed, but the actual binary content was never pushed to the LFS store. 2. **Repository migration issues** - When migrating between Git hosting providers (e.g., GitHub to GitLab, or between self-hosted instances), the standard `git clone` and `git push` commands only transfer the Git objects, not the LFS objects. Without special handling, LFS files are lost in the migration. 3. **The LFS object was deleted** - Some hosting providers have retention policies or manual cleanup processes that may have removed the object from LFS storage. The "smudge filter lfs failed" variant of this error appears when Git tries to convert an LFS pointer back to the actual file content during checkout - a process called "smudging."
First, determine which files are affected. Run:
git lfs ls-files --allLook for files marked with - (dash) instead of * (asterisk) - these are pointers without local objects.
To see which specific object is missing, check the error message for the SHA-256 hash, or run:
git lfs fetch --all 2>&1 | grep "404"If someone else committed the LFS files without proper setup, they likely still have the original files locally. Ask them to:
# First, ensure LFS is installed
git lfs install
# Push all LFS objects to the server
git lfs push --all originIf they have a specific object ID that's missing:
git lfs push --object-id origin <oid>Replace <oid> with the SHA-256 hash from the error message.
If you're migrating a repository, you must explicitly handle LFS objects. From the original (source) repository:
# Clone with full LFS history from source
git clone <source-repo-url> repo-migration
cd repo-migration
git lfs fetch --all
# Add the new remote
git remote add new-origin <target-repo-url>
# Push everything including LFS
git push --mirror new-origin
git lfs push --all new-originImportant: Run git lfs fetch --all before changing remotes to ensure all LFS objects are downloaded locally first.
Sometimes the error occurs for only some objects. Try fetching everything:
git lfs fetch --allThis downloads all LFS objects from all remote refs. If specific objects are truly missing from the server, they'll still fail, but this can resolve issues where objects exist but weren't fetched.
You can also try fetching from a specific branch or ref:
git lfs fetch origin main
git lfs fetch origin --recentEnsure your Git LFS client is up to date and not using deprecated API settings:
# Check version
git lfs version
# Check for deprecated settings
git config -l | grep lfs
# Look for: lfs.batch = false (deprecated)If you see lfs.batch = false, remove it:
git config --unset lfs.batchUpdate Git LFS to the latest version:
# macOS
brew upgrade git-lfs
# Ubuntu/Debian
sudo apt-get update && sudo apt-get install git-lfs
# Windows (with Chocolatey)
choco upgrade git-lfsIf you need to clone a repository but can't fix the missing LFS objects, you can skip the smudge filter:
GIT_LFS_SKIP_SMUDGE=1 git clone <repo-url>This clones the repository with LFS pointer files instead of actual content. Files tracked by LFS will be small text files containing hashes.
Later, you can selectively fetch LFS objects that do exist:
cd <repo>
git lfs pull --include="path/to/specific/file.bin"If you have access to the file from another source (backup, original author, hosting provider's LFS management interface), you can manually place it:
1. Get the SHA-256 hash from the pointer file:
cat path/to/file.bin
# Output shows: oid sha256:<hash>2. Create the object directory structure:
# Extract first 2 and next 2 characters of the hash
# Example hash: abc123def456...
mkdir -p .git/lfs/objects/ab/c13. Place the file in the correct location:
cp /path/to/recovered/file .git/lfs/objects/ab/c1/abc123def456...4. Run git lfs checkout to replace pointer with actual file:
git lfs checkout path/to/file.binIf LFS objects are permanently lost and you need to continue working, you can configure Git LFS to allow pushing even with missing objects:
git config lfs.allowincompletepush trueWarning: This should only be used when objects are confirmed unrecoverable. It allows your repository to remain functional but those specific files will be broken for anyone who clones.
Consider committing new versions of the affected files to replace the broken pointers.
### Preventing This Error
To avoid this problem in the future:
1. Always run `git lfs install` first - This sets up the pre-push hook that automatically uploads LFS objects before Git pushes commits.
2. Verify LFS tracking before committing:
git lfs track "*.psd" # Track Photoshop files
git add .gitattributes # Commit tracking rules first3. For CI/CD pipelines, ensure LFS is installed in the build environment:
# GitHub Actions example
- uses: actions/checkout@v4
with:
lfs: true### GitLab-Specific Issues
GitLab has known issues with LFS objects from forked repositories or merge requests. If you're using GitLab:
- LFS objects from forked repos may not be accessible after merge
- Check GitLab's LFS settings under Repository > Repository Settings
- Consider pushing LFS objects directly to the main repository
### Understanding LFS Pointer Files
A pointer file looks like this:
version https://git-lfs.github.com/spec/v1
oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393
size 12345678If you see this content instead of your binary file, Git LFS failed to "smudge" the pointer into the actual content.
### Hosting Provider LFS Management
Most Git hosting providers have LFS management interfaces:
- GitHub: Settings > Archives > Include Git LFS objects
- GitLab: Repository Settings > Repository > Git LFS
- Bitbucket: Repository settings > Git LFS
These interfaces can help you verify which objects exist and their sizes.
kex_exchange_identification: Connection closed by remote host
Connection closed by remote host when connecting to Git server
fatal: unable to access: Proxy auto-configuration failed
How to fix 'Proxy auto-configuration failed' in Git
fatal: unable to access: Authentication failed (proxy requires basic auth)
How to fix 'Authentication failed (proxy requires basic auth)' in Git
fatal: unable to access: no_proxy configuration not working
How to fix 'no_proxy configuration not working' in Git
fatal: unable to read tree object in treeless clone
How to fix 'unable to read tree object in treeless clone' in Git