为什么git lfs migration不能跟踪所有pdf文件? [英] Why does git lfs migrate not track all pdf files?

查看:99
本文介绍了为什么git lfs migration不能跟踪所有pdf文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

事先注意: git lfs migration import --include ="*.pdf" 的工作方式与 git lfs ls-files 显示 e6521dbea0-large180m.pdf (我想).但是我还是不明白会发生什么.

Note in advance: git lfs migrate import --include="*.pdf" does the job as git lfs ls-files shows e6521dbea0 - large180m.pdf (I guess). But I still don't understand what happens.

我需要使用 git lfs ,并在 C:/Temp/(在Windows上)中创建了一个测试文件夹,以检查是否一切正常.不幸的是,它不是: git lfs ls-files 不会列出任何文件!见下文...

I need to use git lfs and I created a test folder in C:/Temp/ (on windows) to check whether everything is working. Unfortunatelly, it is not: git lfs ls-files does not list any files! See below...

( small.txt small2.txt 是空文本文件, large180m.pdf 是180 MB的大" pdf)

(small.txt and small2.txt are empty text files, large180m.pdf is a "large" pdf with 180 MB)

这是怎么了?我遵循了

注意:最后,lfs应该在所有子文件夹中跟踪pdf

Note: Finally, the lfs should track pdf in all subfolders

来自 git lfs env :

git-lfs/2.3.4 (GitHub; windows amd64; go 1.8.3; git d2f6752f)
git version 2.16.2.windows.1

LocalWorkingDir=C:\Temp
LocalGitDir=C:\Temp\.git

推荐答案

您的问题是您提供给 git lfs migration import 的路径.您提供的路径必须适合 .gitattributes 文件,这意味着必须相对于存储库的根目录指定该路径.您提供了一个绝对路径,它告诉Git LFS匹配存储库根目录中名为 C:的目录下名为 Temp 的子目录中的所有PDF文件.这样的目录在Windows上可能不存在,但在Unix系统上可能存在.

Your problem is the path you gave to git lfs migrate import. The path you provide needs to be suitable for a .gitattributes file, which means it must be specified in relation to the root of your repository. You provided an absolute path instead, which told Git LFS to match all the PDF files in a subdirectory called Temp under a directory in the root of your repository called C:. Such a directory cannot possibly exist on Windows, but could plausibly exist on a Unix system.

相反,您只想将模式指定为 *.pdf ,这将影响存储库中的所有PDF文件,无论它们位于何处.

Instead, you want to specify the pattern as simply *.pdf, which will affect all the PDF files in your repository, wherever they may be located.

此外,如果您有多个分支,甚至没有,则通常都希望迁移所有分支,因此您应该传递-一切.因此,您的调用应类似于 git lfs migration import --everything --include ="*.pdf" .

In addition, if you have multiple branches, or even if you don't, you usually want to migrate all branches, so you should pass --everything. So your invocation should look like git lfs migrate import --everything --include="*.pdf".

这篇关于为什么git lfs migration不能跟踪所有pdf文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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