Why does git lfs migrate not track all pdf files?

后端 未结 2 1156
误落风尘
误落风尘 2021-01-23 07:59

Note in advance: git lfs migrate import --include=\"*.pdf\" does the job as git lfs ls-files shows e6521dbea0 - large180m.pdf

2条回答
  •  悲&欢浪女
    2021-01-23 08:26

    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.

    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.

    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".

提交回复
热议问题