首页 > 解决方案 > “git lfs migrate”中是否包含“git lfs install”?

问题描述

Git lfs 文档说:

Setup Git LFS on your system. You only have to do this once per
    repository per machine:

        git lfs install

现在,既然我不知道做什么的程度,git lfs install我怎么能检查git lfs migrate已经调用git lfs install(文档中没有说git lfs migratehttps ://manpages.debian.org/unstable/git-lfs/git-lfs-migrate .1.en.html ) ?

标签: gitgit-lfs

解决方案


git lfs migrate不叫git lfs installgit lfs install除非您手动适当地设置了过滤器,否则您需要为每个用户和机器对运行一次。

该命令将调用 Git LFS 的过滤器命令安装到用户~/.gitconfig文件和当前存储库中的挂钩中。git lfs install当第一次在存储库中调用某些 Git LFS 命令时,也会安装这些钩子,但只有在已运行或已适当配置过滤器时才会发生这种情况。

除了安装挂钩外,该git lfs install命令还运行以下命令:

git config --global filter.lfs.process "git-lfs filter-process"
git config --global filter.lfs.smudge "git-lfs smudge -- %f"
git config --global filter.lfs.clean "git-lfs clean -- %f"

运行这些命令,或进行等效的编辑,足以让 Git LFS 在不运行git lfs install.

如果您使用的是 Debian 的 Git LFS,可能已经为您设置了过滤器命令,您可以通过检查/etc/gitconfig. 如果是这样,您不需要自己运行它们,尽管您可能想要以防万一您最终使用非 Debian 系统。


推荐阅读