简体   繁体   English

无法使用Git LFS检出文件:“ git-lfs”的未知命令“ post-checkout”

[英]Cannot checkout a file with Git LFS: `unknown command “post-checkout” for “git-lfs”`

When I do the following command while on a feature branch: 当我在功能分支上执行以下命令时:

git checkout origin/master foo.js

I get the following error: 我收到以下错误:

$ git checkout origin/master foo.js
Error: unknown command "post-checkout" for "git-lfs"
Run 'git-lfs --help' for usage.

Why is this happening and how do I fix this issue? 为什么会发生这种情况,如何解决此问题?

Update From this question: Cannot use older version of git-lfs on a repo created using latest version it seems like it may be that I am using an older version of Git-LFS on the master branch compared to the feature branch (I may be wrong). 此问题的更新无法在使用最新版本创建的存储库上使用较旧版本的git-lfs,似乎是与功能分支相比,我在master分支上使用的是较旧版本的Git-LFS(我可能是错误)。

How can I check which version of GIT-LFS is being used for this feature branch? 如何检查此功能分支使用的是哪个版本的GIT-LFS?

The issue is that v2 has a breaking change. 问题是v2发生了重大变化。

The solution is to simply update git-lfs! 解决方案是简单地更新git-lfs!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM