git clone --filter选项的语法是什么? [英] What is the git clone --filter option's syntax?

查看:295
本文介绍了git clone --filter选项的语法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Git 2.17 更改日志对此进行了描述选项:

The Git 2.17 changelog describes this option:

  • 克隆和复制机器提取,这反过来又涉及打包和 解包对象,已被告知如何使用
    省略某些对象 另一个主题介绍的过滤机制.现在知道了
    将生成的包标记为承诺包,以容忍丢失的包
    对象,为狭窄"克隆奠定了基础.
  • The machinery to clone & fetch, which in turn involves packing and unpacking objects, has been told how to omit certain objects using
    the filtering mechanism introduced by another topic. It now knows
    to mark the resulting pack as a promisor pack to tolerate missing
    objects, laying foundation for "narrow" clones.

此标志是否已准备好使用,或者很有可能非常不稳定?有谁知道正确的语法通过?我通过的所有标志均被视为无效的过滤器规范而被拒绝.例如,这些是我尝试按目录过滤的内容:

Is this flag ready to be used, or is it most likely quite unstable? Does anyone know the right syntax to pass? Whatever flags I pass are rejected as being an invalid filter-spec. For example, these were my attempts to filter by directory:

git clone file://path --depth=1 --filter '--subdirectory-filter Assets' TestRepo
git clone file://path --depth=1 --filter --subdirectory-filter Assets TestRepo
git clone file://path --depth=1 --filter Assets TestRepo

推荐答案

filter-spec的格式在git rev-list --help的options部分中定义.您也可以在github上查看.这是当前的内容:

The format for filter-spec is defined in the options section of git rev-list --help. You can also see it on github. Here's what it currently says:

-filter =< filter-spec>

仅对--objects *之一有用;从打印对象列表中删除对象(通常是斑点). < filter-spec>可能是以下之一:

--filter=<filter-spec>

Only useful with one of the --objects*; omits objects (usually blobs) from the list of printed objects. The <filter-spec> may be one of the following:

--filter=blob:none形式省略了所有斑点.

The form --filter=blob:none omits all blobs.

--filter=blob:limit=<n>[kmg]格式忽略了大于n个字节或单位的blob. n可以为零.后缀k,m和g可用于命名KiB,MiB或GiB中的单位.例如,blob:limit = 1k与blob:limit = 1024相同.

The form --filter=blob:limit=<n>[kmg] omits blobs larger than n bytes or units. n may be zero. The suffixes k, m, and g can be used to name units in KiB, MiB, or GiB. For example, blob:limit=1k is the same as blob:limit=1024.

--filter=sparse:oid=<blob-ish>表单使用blob(或blob-expression)< blob-ish>中包含的稀疏校验规范来省略请求的引用上的稀疏校验不需要的blob.

The form --filter=sparse:oid=<blob-ish> uses a sparse-checkout specification contained in the blob (or blob-expression) <blob-ish> to omit blobs that would not be not required for a sparse checkout on the requested refs.

--filter=sparse:path=<path>表单类似地使用< path>中包含的稀疏签出规范.

The form --filter=sparse:path=<path> similarly uses a sparse-checkout specification contained in <path>.

这篇关于git clone --filter选项的语法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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