255

Every time I enter in my command window

git lfs install

the message I get is git: 'lfs' is not a git command. See 'git --help'.

I tried looking up for a solution, but none of the answers were clear. Can someone explain clear how to fix this?

2
  • 6
    on Ubuntu I had forgot to complete the install... sudo apt-get install git-lfs see: github.com/git-lfs/git-lfs/wiki/Installation Commented Jan 30, 2021 at 16:28
  • git lfs install command worked for me. (i'm using windows pc) Commented Dec 3, 2025 at 6:45

12 Answers 12

371

It looks like you haven't downloaded git-lfs on your machine, so git lfs install isn't a registered command by git.

Install git-lfs as outlined below:


1. Pre-Requisites

  • git-lfs requires git version 1.8.3.1 or later. You can check the version you have by running git --version, and update if required.
  • If you are installing on macOS, make sure you have Homebrew installed.

2. Download

Download git-lfs by following the steps based on your operating system.

Debian / Ubuntu

$ curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
$ sudo apt-get install git-lfs

MacOS (Using Homebrew)

$ brew update
$ brew install git-lfs

Windows

Download and run the latest windows installer. The README says "Git LFS is included in the distribution of Git for Windows.".

3. Install

Finally, run git-lfs install to install git-lfs on your system. You can always run git-lfs uninstall to uninstall.


More detailed information (such as for installation on other platforms) can be found on git-lfs's installation page.

Sign up to request clarification or add additional context in comments.

8 Comments

I did install the git lfs, but it is still saying that message
What operating system are you using?
update to this: you need to install a (old) proper version for windows XP 32 bit. I contacted developers and the last one supporting this OS is git-lfs-windows-v2.5.0
I was going through git-lfs.github.com & surprised why the sudo apt-get install git-lfs command was not there! Anyway, thank you so much for the answer!
Why does the quick install page on packagecloud just have the curl command, but not the sudo apt-get install git-lfs command, which is quite important.
|
49

You can't directly use

git lfs install

Instead of that, you can use these commands to download and install (you have to download it before installing).

sudo apt-get install git-lfs
git-lfs install

1 Comment

Or sudo pacman -Suy git-lfs
23

Here is a solution for people installing git-lfs on a system without "sudo". Basically, it is to download the latest tarball (from here), uncompress it, add it to your environment PATH, and install it to git. It worked for me, at least.

wget https://github.com/git-lfs/git-lfs/releases/download/v3.2.0/git-lfs-linux-amd64-v3.2.0.tar.gz
tar -xzf git-lfs-linux-amd64-v3.2.0.tar.gz
PATH=$PATH:/export/fs04/a12/rhuang/git-lfs-3.2.0/
git lfs install
git lfs version

3 Comments

Thanks! Been looking for the local install solution for a while! It works for me!
And don't forget to cd into the untarred folder and run install.sh (may need to modify the prefix to a non-system path) -- github.com/git-lfs/git-lfs#from-binary
@YiboYang what does modify the prefix to a non-system path means here
9

In addition to "arct" answer, if you have an M1 Silicone Mac, you must use the following to install it using homebrew

arch -arm64 brew install git-lfs

Comments

6

none of those pages specify how to install. They just say download and install. I'm running in circles here. Quite frustrating. Download and install, but no mention in getting started as to HOW to install.

"Download and install the Git command line extension. Once downloaded and installed, set up Git LFS for your user account by running: git lfs install"

Sure I can download, but nothing I'm attempting will install. Brew won't recognize the commands, nor will mac port. cd to the location of the folder. Attempt again. Nothing. Not even when running git-lfs from the download and reading those directions is there any clarity. "To get started with Git LFS, the following commands can be used..." They don't work. Can't enter commands in the git-lfs window, nor are they recognized in bash.

Thanks.


Had to go here to find an answer to that assumed process:

https://www.addictivetips.com/mac-os/run-shell-sh-script-on-macos/

How to run a Shell or .sh script on macOS

cd ~/Downloads/git-lfs-darwin-amd64-v2.13.2

chmod +x install.sh

sh install.sh

1 Comment

You are a life saver! tnx mate
4

LFS is not part of Git, it needs to be installed separately. See the Git LFS site. Following the 'Getting Started' instructions for your platform should resolve the issue.

Comments

3

If you do not have sudo permissions (e.g., on a virtual machine), you can install Git LFS using Conda. Simply run:

conda install -c conda-forge git-lfs

Then, ensure Git LFS is initialized by running:

git lfs install

Comments

2

Note if you are on Apple Silicon (eg M1), and using homebrew installed in the default way, homebrew will be installed at /opt/homebrew. (See https://docs.brew.sh/Installation).

This path (/opt/homebrew) is not part of the default PATH env variable. Looks like this causes issues in git recognizing lfs in subsequent git lfs ... commands.

Fix is to include it in the path: export PATH=$PATH:/opt/homebrew/bin. And then do the git lfs ... operations.

Comments

1

On Arch Linux, sudo pacman -S git-lfs

Comments

0

I had this when building with Atlassian Bamboo and the resolution was to build first time without lfs checked (advanced options). After that you can go back and select lfs and it fetches fine from git without the lfs error.

Comments

0

use git bash cmd window, also make sure you've downloaded and installed git lfs

my answer is on the assumption that you are probably using Windows OS, so using the other given solutions may not work, so this is for if you are on windows

1 Comment

Thank you for your interest in contributing to the Stack Overflow community. This question already has quite a few answers—including one that has been extensively validated by the community. Are you certain your approach hasn’t been given previously? If so, it would be useful to explain how your approach is different, under what circumstances your approach might be preferred, and/or why you think the previous answers aren’t sufficient. Can you kindly edit your answer to offer an explanation?
0

If you have committed a file larger than 100 MB and cannot push it due to Git's file size limitations, you will need to use Git LFS. If you are still facing errors after installing Git LFS and need to add it, you will have to remove the large file from your commit history.

This can be done by using the following command:

git lfs migrate import --include="*.csv, *.psd"

For more, you can check the github official doc

(https://docs.github.com/en/repositories/working-with-files/managing-large-files/removing-files-from-git-large-file-storage)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.