git only在Gitlab CI上为LFS文件克隆sha [英] git only clones sha for LFS files on Gitlab CI
问题描述
我将.png
个文件推送到我的gitlab.com存储库中,例如repo_a
,每个文件的大小均为2 + MB,并由git-lfs
跟踪.在安装了git-lfs
的另一个存储库repo_b
上的CI作业中,克隆了repo_a.现在,我看到所有.png文件的大小为132,这似乎与sha
输出的体积相同(如下所示.注意:出于隐私目的,填充了一些值):
I pushed .png
files, each of which is 2+MB file size and tracked by git-lfs
, to my gitlab.com repository, say repo_a
. In CI job on another repo repo_b
where git-lfs
is installed, repo_a is cloned. Now I see the size of all .png files are 132, which seems to be the same volume as sha
output (as the following. Note: some values are populated for privacy):
$ git show HEAD:file-a.png | tee sha_temp
version https://git-lfs.github.com/spec/v1
oid sha256:shashashaaaashashashaaaashashashaaaashashashaaaashashashaaaa
size 2430019
$ ls -l sha_temp
-rw-rw-r-- 1 crookednoodle crookednoodle 132 Nov 7 05:35 sha_temp
但是,当我git clone
repo_a时,在我的计算机上而不是在Gitlab CI上,我可以看到原始文件.
However, On my computer instead on Gitlab CI, I can see the original files when I git clone
the repo_a.
这使我感到这些文件的内容仍然是指针,而不是原始文件.我还注意到,在我的计算机上,我在输出中看到原始文件是这样下载的:
This makes me feel that the content of these files are still pointers, not the original files. I also noticed that on my computer, I see in the output the original files are downloaded like this:
Downloading file-a.png (2.5 MB)
但是我在CI作业的输出中看不到这一点.
But I don't see this in the output on CI job.
显然相关,随后通过OpenCV打开图像的过程失败.
Obviously related, subsequent process that opens the images by OpenCV fails.
怎么了?
推荐答案
由我自己解决(解决)该问题.在目标存储库中,我修改了CI脚本以运行git lfs pull
.
Managed to solve (get around) the issue by myself. In the targeted repo, I modified the CI script to run git lfs pull
.
这篇关于git only在Gitlab CI上为LFS文件克隆sha的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!