如何在WSL2上安装git-lfs?

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

在Kali或Ubuntu上安装git-lfs很简单,但是步骤不容易找到。在我的情况下,是因为我需要它来管理git子仓库。
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.
1个回答

18

你可以通过Linux发行版的软件包管理器在WSL上安装git-lfs。例如,在Debian或Ubuntu上的WSL中,你可以输入以下命令:

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

阅读更多

如果你想直接在Windows上安装git-lfs:

  1. 这里下载Windows安装程序
  2. 运行Windows安装程序
  3. 打开命令提示符Git Bash窗口,并运行git lfs install

1
只是为了明确,这是安装在Ubuntu上的--对于任何Ubuntu用户(不仅仅是WSL),指南都是相同的,如果您在WSL上使用非Ubuntu发行版,则会有所不同。 - NotTheDr01ds

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接