DEV Community

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

Posted on

11 1

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay