Search code examples
git-lfswindows-subsystem-for-linux

How to install git-lfs on WSL2?


fatal: 'lfs' appears to be a git command, but we were not
able to execute it. Maybe git-lfs is broken?

Installing git-lfs on kali or ubuntu is simple, but steps are not easy to find. In my case it was because I needed it for git subrepo

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.

Solution

  • You can install git-lfs on WSL through your linux distribution's package manager. For example, in Debian or Ubuntu on WSL you would type:

    1. sudo apt-get install git-lfs
    2. git lfs install

    Readme

    If you instead want to install git-lfs it on Windows directly:

    1. Download the windows installer from here
    2. Run the windows installer
    3. start a command prompt/or git bash for windows prompt and run git lfs install