如何在Mac和Linux上批量下载所有git LFS文件? [英] How can I download all git LFS files in batches on mac and linux?

查看:190
本文介绍了如何在Mac和Linux上批量下载所有git LFS文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Windows中运行git lfs clone somerepository时,我得到以下输出

When I'm running git lfs clone somerepository in Windows, I've got the following output

Cloning into 'somerepository'...
remote: Counting objects: 24028, done.
remote: Compressing objects: 100% (5003/5003), done.
remote: Total 24028 (delta 7376), reused 23762 (delta 7265)
Receiving objects: 100% (24028/24028), 7.12 MiB | 3.86 MiB/s, done.
Resolving deltas: 100% (7376/7376), done.
Git LFS: (57 of 57 files) 1.57 GB / 1.57 GB

最后一行表示git分批下载了al个文件(像git pull时不是1个文件),而且速度非常快.

Last line means git downloaded al files in a few batches (not 1 file at time like git pull) and it's quite quick.

在Linux和Mac中,同一命令仅执行前6个步骤,也不执行最后一个步骤,而将所有LFS跟踪的文件仅用作指针.如果我执行抓取/签出/拉取操作,则git会一次将内容下载到一个文件,而且下载速度非常慢.我比较了不同Linux/Windows/Mac系统中的所有配置,并且行为与最新版本的git和git-lfs相同.

In linux and mac instead, the same command does only the first 6 steps and nor the last one, leaving all LFS-tracked files only as a pointer. If I do a fetch/checkout/pull, git download the content one file at the time andvery slowly. I compared all configuration amongst different Linux/Windows/Mac system and behaviour are all the same with latest version of git and git-lfs.

我想知道git lfs clone运行的最后一条命令是什么,以及如何在Linux和Mac上手动或自动触发它.

I'd like to know what is the last command that git lfs clone run and how to trigger it manually or automatically even on Linux and Mac.

谢谢

推荐答案

它在Gerrit服务器上按预期工作:

It worked as expected to me on a Gerrit server:

> git lfs clone https://USER@GERRIT-SERVER/a/REPOSITORY
Cloning into 'REPOSITORY'...
remote: Counting objects: 5, done
remote: Finding sources: 100% (5/5)
remote: Total 929 (delta 0), reused 929 (delta 0)
Receiving objects: 100% (929/929), 151.10 KiB | 0 bytes/s, done.
Resolving deltas: 100% (275/275), done.
Checking connectivity... done.
Git LFS: (2 of 2 files) 1.77 MB / 1.77 MB

> git --version
git version 2.7.4

> git lfs version
git-lfs/1.5.3 (GitHub; linux amd64; go 1.7.4; git 23455e48)

$ HOME/.gitconfig LFS内容:

$HOME/.gitconfig LFS contents:

[filter "lfs"]
    clean = git-lfs clean -- %f
    smudge = git-lfs smudge -- %f
    process = git-lfs filter-process
    required = true

这篇关于如何在Mac和Linux上批量下载所有git LFS文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆