简体   繁体   中英

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).

How can I check which version of GIT-LFS is being used for this feature branch?

The issue is that v2 has a breaking change.

The solution is to simply update git-lfs!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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