DEV Community

Cover image for Dealing with "git-lfs" was not found on your path
Mattia Orfano
Mattia Orfano

Posted on

Dealing with "git-lfs" was not found on your path

After 2 weeks of sweat and tears, today I was ready to release a few changes I've made to one of my client's GITHUB repositories.

I cracked my fingers with a smile on my face, and typed:

git rebase main
... solved a bunch of conflicts
git push -f
Enter fullscreen mode Exit fullscreen mode

And.... fuck!

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'.

error: failed to push some refs to 'github.com:....git'
Enter fullscreen mode Exit fullscreen mode

The typical reaction of a junior developer would be to do exactly what the error message says: delete the file.

But my parents told me long ago not to trust strangers (or random messages from the internet), and since this is a legacy project where several other developers work on a daily basis, I took a different approach.

The solution was pretty simple. On MacOS:

brew install git-lfs
git lfs install
git push -f
Enter fullscreen mode Exit fullscreen mode

Thank me later! Bye ;)
Read my other #10stips

Top comments (0)