LFS git: 'lfs' is not a git command. See 'git --help'.
我在 macOS 上遇到了这个问题。在终端上,
git lfs
命令正常工作。但是当我从某个脚本中运行这个命令时,它会尝试在 git 中找到 lfs
命令,这是我目前的理解。请帮我解决这个问题。
LFS git: 'lfs' is not a git command. See 'git --help'.
git lfs
命令正常工作。但是当我从某个脚本中运行这个命令时,它会尝试在 git 中找到 lfs
命令,这是我目前的理解。brew install git-lfs
port install git-lfs
验证安装是否成功:
$ git lfs install
> Git LFS initialized.
更多详细信息请参考此文档:https://help.github.com/en/github/managing-large-files/installing-git-large-file-storage
brew install git-lfs
进行安装,并成功地使用LFS进行推送,但在运行git lfs install
之前仍然无法运行git lfs checkout
。 - kwkt/usr/bin/git
中,安装了从https://git-lfs.github.com/
下载的git-lfs之后,你会发现git-lfs被放置在/usr/local/bin/git-lfs
中。你可能需要将/usr/local/bin
添加到你的PATH中,以便git能够找到它。(我没有查看brew和macports做了什么)/usr/local/bin
已经在我的路径中了。这只发生在尝试从第三方应用程序(matlab)使用 git-lfs 时。我想知道是否将符号链接放到 /usr/bin/git-lfs
中的 /usr/local/bin/git-lfs
中会起作用,或者是否有一些方法可以强制 matlab 在 /usr/local/bin
中搜索。 - Brian D/usr/local/bin
添加到PATH对我来说是关键。 [~, result] = system('echo -n $PATH'); result = [result ':/usr/local/bin']; setenv('PATH', result);
(在matlab中) - Brian Dsudo ./install.sh
就是这样。# 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