gpt4 book ai didi

git - 无需 checkout 即可下载 Git LFS 文件

转载 作者:行者123 更新时间:2023-12-02 11:18:50 24 4
gpt4 key购买 nike

我正在寻找一种方法来下载我在存储库中拥有的一些 git LFS zip 文件,而无需 checkout 整个存储库。
我尝试了以下方法: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
    以上似乎都不起作用
    任何线索将不胜感激。

    最佳答案

    如果存储库是私有(private)的,那么您需要在 curl 命令中传递 Gitlab 授权 token 或帐户身份验证凭据。
    您可能会发现以下有用的链接:
    https://docs.gitlab.com/ce/api/repository_files.html#get-file-from-repository
    https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html

    关于git - 无需 checkout 即可下载 Git LFS 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55897037/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com