Noman Maqsood
Noman Maqsood

Reputation: 499

"git: 'lfs' is not a git command" on macOS

LFS git: 'lfs' is not a git command. See 'git --help'.

I am facing this issue on macOS. The git lfs command is working fine from the Terminal. But when I am running this command from some script it is trying to find the lfs command in git, and that is what I understand so far.

Please help me out in fixing this.

Upvotes: 40

Views: 54002

Answers (4)

buqing
buqing

Reputation: 1015

Another way for the mac users who doesn't have brew, you can install git lfs using conda

conda install git-lfs

Upvotes: 1

MaduKan
MaduKan

Reputation: 670

If you aren't using MacPorts or Homebrew, there is an installer for macOS here:

Git Large File Storage
https://git-lfs.com/

  1. Download the correct file and extract
  2. Then run sudo ./install.sh

That's pretty much it.

If you need a refresher on how to use:

# 1)  Setup Git LFS on your system. You only have to do this once per user account:

git lfs install

# 2) Configure the file types or paths to be tracked using

git lfs track "*.bin"

# 3) Then just add the files as usual with git add command

# Tracked files can also be configured manually using the .gitattributes file

Upvotes: 3

welch
welch

Reputation: 964

When using the apple xcode-provided git, in /usr/bin/git, and after installing the git-lfs download from https://git-lfs.github.com/, you'll find git-lfs was placed in /usr/local/bin/git-lfs. You may need to add /usr/local/bin to your PATH so that git can find this. (I've not looked to see what brew and macports do)

Upvotes: 7

Max Peng
Max Peng

Reputation: 3227

  • Homebrew user run
brew install git-lfs
  • MacPorts user run
port install git-lfs

Verify that the installation was successful:

$ git lfs install
> Git LFS initialized.

For more details refer to this doc: https://help.github.com/en/github/managing-large-files/installing-git-large-file-storage

Upvotes: 53

Related Questions