Git-lfs: 'git-lfs' was not found on your path in SourceTree

Created on 21 Nov 2015  Â·  18Comments  Â·  Source: git-lfs/git-lfs

I downloaded Github for MAC OS and setup git lfs for my repo. All works great when I am using my repo with Github MAC app. When I open the same repo with SourceTree and push to remote, 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.

I know that my SourceTree app is using the _System Git version_. How do I set the 'git-lfs' into my path? And why does 'git-lfs' complains in one client and not in the other one?

Most helpful comment

I delete .git/hooks/pre-push in my local repository and it worked for me

All 18 comments

There's a similar bug filed in #846. I think you'll have to go to SourceTree support. I have no idea how it manages its git version and paths.

@pprochazka72 I had the same problem and received the same error message using Source Tree 1.8.2.2 on Windows. For me the solution was to open the Source Tree Terminal window and inspect the paths and locations of files there. Ultimately I copied the git-lfs executable into one of the folders being searched on the path.

To help troubleshoot the path I injected more output into the error message window by editing the script file mentioned by the error message: '.git/hooks/pre-push' and added the command 'which git-lfs' to the output. It spit out a list of paths being searched. I copied the git-lfs executable into one of those.

These are steps to help troubleshoot. I won't specify any more granularity because the environments differ and this information should be enough to help some other people having the same issue.

I delete .git/hooks/pre-push in my local repository and it worked for me

@chocolim delete .git/hooks/pre-push means you will not use git-lfs. You will just commit your large file into your git repository.
Just try push your code by using command line.

@pprochazka72 You may config SourceTree use git within it self.
Your SourceTree will not find git-lfs in your system PATH.
I use SmartGit, and I use follow command to make git-lfs available for my SmartGit. You can modify it for your SourceTree

ln /Applications/SmartGit.app/Contents/Resources/git/bin/git-lfs /Applications/GitHub\ Desktop.app/Contents/Resources/git-lfs/bin/git-lfs

Very clever and thank k8nd sir.

Sent from my Samsung Galaxy smartphone.-------- Original message --------From: 勤 [email protected] Date: 2016-04-28 11:04 PM (GMT-07:00) To: github/git-lfs [email protected] Subject: Re: [github/git-lfs] 'git-lfs' was not found on your path in
SourceTree (#853)
@pprochazka72 You may config SourceTree use git within it self.

Your SourceTree will not find git-lfs in your system PATH.

I use SmartGit, and I use follow command to make git-lfs available for my SmartGit. You can modify it for your SourceTree

ln /Applications/SmartGit.app/Contents/Resources/git/bin/git-lfs /Applications/GitHub\ Desktop.app/Contents/Resources/git-lfs/bin/git-lfs

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

For SmartGit 8 and git-lfs installed via brew I used the following command to make git-lfs available to SmartGit:

ln /usr/local/bin/git-lfs /Applications/SmartGit.app/Contents/Resources/git/bin/git-lfs

@chocolim Thank you it works for me!

Removing file .git/hooks/pre-push solved this problem

installation guide is here : https://git-lfs.github.com/ . Just download and follow the instructions to install git-lfs on your local

deleting: .git/hooks/pre-push solves the problem immediatly.

SmartGit 8.0.5 does not have git-lfs inside.

Also it has some weird internal PATH:

/usr/local/git/libexec/git-core:/Applications/SmartGit.app/Contents/Resources:/usr/bin:/bin:/usr/sbin:/sbin

To make it see my HomeBrew git-lfs I had to run

sudo ln -s /usr/local/bin/git-lfs /usr/local/git/libexec/git-core/git-lfs

Is there any doc explaining where SmartGit searches for git-lfs provided we use externa git executable?

@diophung Thank you it works for me!

Funny, for me it says "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/post-checkout."

*Don't delete: .git/hooks/pre-push *

That just turns off LFS - and will cause issues if you're submitting to a shared repository. It's much better to resolve the errors by linking LFS as other posters have outlined above. Of course if you never intended to use LFS then removing LFS hooks is reasonable.

execute this command
rm .git/hooks/pre-push
and try pull from remote to test

This solved for me sudo ln -s /usr/local/bin/git-lfs /usr/local/git/libexec/git-core/git-lfs

This solved for me sudo ln -s /usr/local/bin/git-lfs /usr/local/git/libexec/git-core/git-lfs

This returns "ln: /usr/local/git/libexec/git-core/git-lfs: No such file or directory" for me. I have no git directory in "/usr/local/git/".

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cukiakimani picture cukiakimani  Â·  3Comments

pointcache picture pointcache  Â·  4Comments

panpan0000 picture panpan0000  Â·  3Comments

danielbayley picture danielbayley  Â·  4Comments

Vdragon picture Vdragon  Â·  3Comments