git install_error ai_generated true

错误:LFS:无法签出 '<文件>',因为它包含 LFS 指针内容但 Git LFS 未安装或未配置

error: LFS: Unable to checkout '<file>' because it has LFS pointer content but Git LFS is not installed or configured

ID: git/lfs-pointer-not-smudged

其他格式: JSON · Markdown 中文 · English
93%修复率
86%置信度
1证据数
2023-12-01首次发现

版本兼容性

版本状态引入弃用备注
git-lfs 3.3.0 active
git-lfs 3.4.1 active
git-lfs 3.5.0 active

根因分析

由 Git LFS 跟踪的文件仅包含指针文本(例如 'version https://git-lfs.github.com/spec/v1'),而不是实际内容,因为 Git LFS 未安装、未初始化或缺少 smudge 过滤器。

English

A file tracked by Git LFS contains only the pointer text (e.g., 'version https://git-lfs.github.com/spec/v1') instead of the actual content because Git LFS is not installed, not initialized, or the smudge filter is missing.

generic

官方文档

https://github.com/git-lfs/git-lfs/blob/main/docs/man/git-lfs.1.ronn

解决方案

  1. Install Git LFS: 'brew install git-lfs' (macOS) or 'sudo apt-get install git-lfs' (Linux), then run 'git lfs install' to set up filters, and 'git lfs pull' to download the actual file content
  2. If installation is not possible, manually download the file from the LFS remote server using the OID in the pointer file: 'curl -H "Accept: application/vnd.git-lfs+json" <lfs-endpoint>/objects/<oid>'

无效尝试

常见但无效的做法:

  1. 70% 失败

    This bypasses LFS tracking, causing the large file to be stored directly in Git, defeating the purpose of LFS and bloating the repository.

  2. 90% 失败

    The 'git lfs' command does not exist if LFS is not installed; the shell will return 'command not found'.