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

Please help me understand what the below error message means and how to comply with its request.

I want to copy an existing local git repo; then push that copy to a newly created remote.

But I get the following error:

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 .git/hooks/pre-push.

The code I used immediately prior to getting this message is:

# create new git repo at https://github.com/username/foo-bar.git
cp -r OldProject/ NewProject/
cd NewProject/
git remote remove origin # Remove prior origin from copy operation
git init
git remote add origin https://github.com/username/foo-bar.git
git add -A
git commit -m "first commit"
git push -u origin master

What am I doing wrong and how can I fix it? Please help me understand what the above error message means and how to comply with its request.


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

LFS is "Large File Storage," an extension for git that keeps large files outside of the actual repository so it doesn't become slow. When the error says "not found on your path," it means git was looking for a program that you don't have installed. You can install it using the instructions on https://git-lfs.github.com/.

A hook, by the way, is a bit of code git runs when you do some action. They are stored in the repository, in the hidden directory .git/hooks.


I had the same problem, and solved it by deleting .git/hooks/pre-push


I think I may have solved it for people who may be using SourceTree. For me, since I installed SourceTree before git on a fresh machine, SourceTree was using an embedded version of git, which didn't have git lfs installed I guess.

So I went to Tools > Options > Git, and at the bottom I noticed some settings to choose which version of git that Sourcetree uses.: Tools > Options > Git version settings

So I had previously had it on "Embedded", but I changed it to System, and things have been good so far.

While this may be fairly obvious to most, I think I will mention it anyways: This will only work if you have git and lfs installed on your system from https://git-scm.com/. The git installer has an option to install git-lfs at some point during installation.

EDIT: So after this, the problems still persisted, but then I remembered that this issue only started after I had installed a new M.2 NVME drive and loaded my repo onto it.

So I guess if you run git lfs from a drive that is slower than the drive that is slower than the repo, Sourcetree will think that you don't have git lfs configured. So I uninstalled Git and LFS, and reinstalled them on my fastest drive, the M.2 NVME drive, and I haven't had any issues since.