本文介绍了Git Large File Storage的存储机制是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述 Github最近推出了一个到git以不同的方式存储大文件。 扩展名所代表的意思是用Git中的文本指针替换大文件

您可以在查看:

 类型指针结构{
版本字符串
Oid字符串
大小int64
OidType字符串

and 来源意味着 git-lfs 可以使用 以便:


  • 在结账时下载实际文件

  • 在提交时将其存储在其外部源中。


请参阅:



 版本https://git-lfs.github.com/spec/v1 
oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393
size 12345
(ending \\\



这在Git 2.12(2017年第一季度)中设置了一个警告

请参阅(2016年12月18日)和(2016年12月3日)作者:。


$ b


Github recently introduced a extension to git for storing large files in a different way. What exactly they mean by extension replaces large files with text pointers inside Git ?

解决方案

You can see in the git-lfs sources how a "text pointer" is defined:

type Pointer struct {
    Version string
    Oid     string
    Size    int64
    OidType string
}

The smudge and clean sources means git-lfs can use a content filter driver in order to:

  • download the actual files on checkout
  • store them in their external source on commit.

See the pointer specs:

version https://git-lfs.github.com/spec/v1
oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393
size 12345
(ending \n)

The actual file is upload to or downloaded from a server which respect the Git-LFS API.

This is confirmed by the git-lfs man page, which mentions:

You need a Git server which implements that API in order to support for uploading and downloading binary content.

Regarding the content filter driver (which exists in Git for a long time, well before lfs, and is used here by lfs to add this "large file management" feature), this is where the bulk of the work happens:

Git 2.11 (Nov. 2016) has a commit detailing even more how this works: commit edcc858, helped by Martin-Louis Bright and signed-off by: Lars Schneider.

This has for consequence a warning set in Git 2.12 (Q1 2017)

See commit 7eeda8b (18 Dec 2016), and commit c6b0831 (03 Dec 2016) by Lars Schneider (larsxschneider).

这篇关于Git Large File Storage的存储机制是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 10:38
查看更多