#lfs #git #file #pull #token #git-lfs #verification

bin+lib lfspull

A simple git lfs file pulling implementation in pure rust. Can only pull files / folders and only support token-auth for now.

4 releases (2 breaking)

0.3.1 Sep 6, 2024
0.3.0 Aug 21, 2024
0.2.0 Mar 27, 2023
0.1.0 Oct 21, 2022

#186 in Authentication

Download history 21/week @ 2024-07-23 9/week @ 2024-07-30 152/week @ 2024-08-06 121/week @ 2024-08-13 309/week @ 2024-08-20 140/week @ 2024-08-27 260/week @ 2024-09-03 148/week @ 2024-09-10 136/week @ 2024-09-17 187/week @ 2024-09-24 129/week @ 2024-10-01 267/week @ 2024-10-08 251/week @ 2024-10-15 216/week @ 2024-10-22 131/week @ 2024-10-29 174/week @ 2024-11-05

815 downloads per month

MIT license

35KB
680 lines

LFSPull - a simple pulling tool for git-lfs

Crates.io Documentation CI Coverage Status License

Features

LFSPull allows you to pull files from git-lfs. It currently supports:

  • Token-auth only
  • Pulling single files
  • Globbing patterns and pulling all matches
  • Cache-compatible with the original git-lfs
  • Hash verification of the downloaded file

CLI guide

The CLI is pretty straight forward.

  • -f / --file-to-pull [FILE] single file download mode
    • e.g. lfspull -f my_file.tar.gz downloads the file
  • '-r / --recurse-pattern [PATTERN]' downloads everything that matches the pattern
    • e.g. 'lfspull -r "*.tgz"' downloads all .tgz files in this folder
    • e.g. 'lfspull -r "**/*.tgz"' downloads all .tgz files this folder and all subfolders
  • '-b / --random-bytes [RANDOM_BYTES]' for temp file name. See https://docs.rs/tempfile/latest/tempfile/struct.Builder.html#method.rand_bytes
  • '-a / --access-token [TOKEN]' sets the token - can also be set via $ACCESS_TOKEN from env
  • '-v' for verbose mode

Library API guide

Please see our docs.rs for example code and the gherkin tests for how to check the origin of the file.

Changelog

0.3.1

  • fix bug when trying to rename temp file to cache file, but cache file is already created and locked by other parallel job

0.3.0

  • use stream_bytes to download object directly into a temporary files and avoid 'memory allocation of x bytes failed'

Dependencies

~10–25MB
~378K SLoC