【发布时间】:2020-10-30 14:02:02
【问题描述】:
我有一个包含几个大文件的 git 存储库。 Git-LFS 已启用。我想将其中一个文件引入 Docker 容器。我已经在容器中安装了 git-lfs。到目前为止,我有:
RUN git clone --no-checkout --depth 1 https://github.com/my-org/my-data-repo.git
RUN cd my-data-repo
RUN git lfs pull -I data/my-large-file.csv
文件实际上已下载,但 Docker 构建过程失败,因为我收到以下错误:
Error updating the git index: (1/1), 90 MB | 4.8 MB/s
error: data/my-large-file.csv: cannot add to the index - missing --add option?
fatal: Unable to process path data/my-large-file.csv
Errors logged to .git/lfs/logs/20200709T142011.864584.log
Use `git lfs logs last` to view the log.
如何在不抛出异常杀死 Docker 构建过程的情况下做到这一点?
【问题讨论】:
-
看起来你在打这个:github.com/git-lfs/git-lfs/issues/2937#issuecomment-407024556 如果你使用
--no-checkout标志,那么你不能再拉文件而不破坏 git 的索引 -
启用 GIT_LFS_SKIP_SMUDGE=1 时,仍然报错:
Not in a git repository. -
如何启用 GIT_LFS_SKIP_SMUDGE=1?您能否在您的问题中发布显示此内容的更新,它可能会有所帮助
标签: git docker github docker-compose git-lfs