git fetch - Prevent "git archive" from talking to remote - Stack Overflow

I have a CI job which does a shallow checkout like this:git clone --filter=blob:none --no-checkout $RE

I have a CI job which does a shallow checkout like this:

git clone --filter=blob:none --no-checkout $REPO .
git fetch origin $BRANCH
git checkout -f $COMMIT

I wanted to then archive that shallow copy of the repo as a tarball, so I did this:

git archive --format=tar --output=repo.tar HEAD

To my surprise this was not a completely local operation, it seems to be talking to the remote and downloading large objects (including LFS):

remote: Enumerating objects: 27903, done.
remote: Counting objects: 100% (14635/14635), done.
remote: Compressing objects: 100% (12500/12500), done.
Receiving objects: 100% (27903/27903), 290.57 MiB | 22.74 MiB/s, done.
remote: Total 27903 (delta 3317), reused 2370 (delta 2135), pack-reused 13268 (from 1)
Resolving deltas: 100% (6309/6309), done. 40% (2524/6309)
Downloading {redacted} (78 MB)
Downloading {redacted} (57 MB)
Downloading {redacted} (59 MB)
Downloading {redacted} (2.0 MB)
Downloading {redacted} (2.3 MB)
Downloading {redacted} (1.2 MB)
Downloading {redacted} (2.3 MB)
Downloading {redacted} (1.8 MB)
Downloading {redacted} (3.3 MB)
Downloading {redacted} (4.2 MB)
Downloading {redacted} (3.5 MB)
Downloading {redacted} (5.7 MB)

I would like for git archive to just make an archive of what is present locally and not talk to the remote at all, is this possible?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742390381a4434895.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信