Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

'git lfs install' failed with code 2

I'm trying to clone my project from bitbucket with SourceTree, and after a while I'm prompted with this:



But when I click Ja (yes) I get this:


Any known solutions?

I've tried running as ST as admin. Same happens.

2 answers

Hi, I had the same error and I was able to fix it with these steps:

  1. Close Sourcetree
  2. Go to your repo folder
  3. Go to .git/hooks folder
  4. Delete post-checkout, post-commit, post-merge and pre-push files
  5. Open Sourcetree again and press the 'Yes' button to install LFS stuff. This time it should be successful.

Hope it helps.

I have the same issue.

LFS is not working: pushing a file (filetype is tracked for LFS) is not stored in the LFS store. (checked with 'git lfs ls-files')

When I open a terminal and manually enter the command 'git lfs install', there are no errors:
- Updated git hooks.
- Git LFS initialized.

But after closing and opening sourcetree, the messages appear again.

I found out that the issue is solved when I select the embedded Git Version, which is different from the system Git Version.

I checked the release notes for the higher versions, but I couldn't find anything related.



My problem is that someone who has the wrong version and ignores the above messages and clones the repository, LFS files are not pulled, instead the LFS pointer file is placed in the working directory.


Any help on this?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

5,738 views 4 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you