git: 'lfs' is not a git command unclear

GitGithub

Git Problem Overview


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?

Git Solutions


Solution 1 - Git

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.2 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.

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.

Solution 2 - Git

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

Solution 3 - Git

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

Solution 4 - Git

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.

Solution 5 - Git

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.

Solution 6 - Git

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionbockdavidsonView Question on Stackoverflow
Solution 1 - GitaerView Answer on Stackoverflow
Solution 2 - Gitchamod rathnayakeView Answer on Stackoverflow
Solution 3 - GitLOTUSMSView Answer on Stackoverflow
Solution 4 - GitCharles MagerView Answer on Stackoverflow
Solution 5 - GitTim FoshView Answer on Stackoverflow
Solution 6 - GitAndrew TaylorView Answer on Stackoverflow