无需结帐即可下载 Git LFS 文件

A.R*_*K.S 7 git git-lfs

我正在寻找一种方法来下载我在 repo 中的一些 git LFS zip 文件,而不必签出整个存储库。

我尝试了以下方法:

curl -L <URL to the file RAW download on github page>

  • 这将下载一个 html 文件而不是实际文件。

curl -L <URL from .lfsconfig file + object ID from the file's pointer information in git repo>

  • 给出“未找到”错误

更多示例尝试:

curl  -L https://gitlfs.es.com/api/company/myrepository/content/framework/7d5dfcf764118df4867dc676b615e1ee4bf67e5b37fd56275f8845d
 
curl  -L https://gitlfs.es.com/api/company/myrepository/7d5dfcf764118df4d188d5838867dc676b615e1ee4bf67e5b37fd56275f8
 
curl  -L https://gitlfs.es.com/api/company/myrepository/sha256:7d5dfcf764118df4d188d5838867dc676b615e1ee4bf67e5b37fd56275f8845d
Run Code Online (Sandbox Code Playgroud)

以上似乎都不起作用

任何线索将不胜感激。

小智 1

如果存储库是私有的,那么您需要在curl命令中传递Gitlab授权令牌或帐户身份验证凭据。

您可能会发现以下链接很有用:

https://docs.gitlab.com/ce/api/repository_files.html#get-file-from-repository https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html