7

I'm looking for a way to download some git LFS zip files I have in a repo without having to checkout the entire repository.

I have tried the following:

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

  • This downloads a html file and not the actual file.

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

  • Gives a "Not found" error

More example tries:

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

None of the above seems to work

Any leads will be appreciated.

Olivia Stork
  • 4,660
  • 5
  • 27
  • 40
A.R.K.S
  • 1,692
  • 5
  • 18
  • 40
  • The URL schema is described here: https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md – Robert May 07 '19 at 17:09

1 Answers1

1

If the repository is private then you need to pass either Gitlab authorization token or account authentication credentials in curl command.

You may find links below useful:

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

initanmol
  • 340
  • 1
  • 4