Your Code. Your Rules.

git-lfs Not Installed

git: 'lfs' is not a git command - git-lfs: not found - This repository is configured for Git LFS but 'git-lfs' was not found on your path.

git-lfs Is Not Installed

Symptom

Any git lfs command fails:

git: 'lfs' is not a git command. See 'git --help'.

A clone of a repository that uses Git LFS stops at checkout:

git-lfs filter-process: 1: git-lfs: not found
fatal: the remote end hung up unexpectedly
warning: Clone succeeded, but checkout failed.

A push from a repository with the Git LFS pre-push hook is refused locally:

This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').

Cause

  • The git-lfs program is not installed on this machine.
  • It is installed, but not on the PATH of the process that runs git (a GUI client, an IDE, a CI job).
  • The clone and push errors also need a leftover setup: a git config (from an earlier git lfs install) or a repository hook still calls git-lfs.

Diagnose

1. Ask git-lfs for its version:

git lfs version

A version string means git-lfs is found. 'lfs' is not a git command means it is not.

2. Look for the program on the PATH (Linux and macOS: command -v, Windows: where):

command -v git-lfs

3. See which git config calls git-lfs:

git config --show-origin --get-regexp "^filter\.lfs\."

Fix

Option A - Install git-lfs (recommended)

Git finds the git-lfs executable on your PATH and runs it as git lfs.

Windows

Git for Windows

Git LFS is bundled with Git for Windows. Keep the "Git LFS" option checked in the installer - it is checked by default.

Download the installer

Download the Windows installer from the git-lfs releases page.

macOS

Homebrew

brew install git-lfs
Linux

Debian / Ubuntu

sudo apt install git-lfs

Other distributions

Install the git-lfs package from your distribution, or download a prebuilt binary for your OS/arch from the git-lfs releases page and place it on your PATH.

Verify with git lfs version - it should print a version string.

Then turn it on once per machine:

git lfs install

Delete the clone that failed and clone again. A refused push can simply be run again: the hook now uploads the LFS objects.

Option B - Stop using Git LFS in this repository

Only when no file of the repository is stored in Git LFS: delete .git/hooks/pre-push, as the message says. If LFS files exist, pushing without the hook leaves the server without their objects - see LFS Object Does Not Exist.

Verify

git lfs version

It prints a version string, and a new clone checks out with no error.

Prevent

  • Install git-lfs on every machine and CI image that works with the repository, then run git lfs install.
  • Start GUI clients and IDEs from an environment where git lfs version works.

Related