Skip to content

A custom transfer agent for git-lfs that uses rclone to transfer files.

License

Notifications You must be signed in to change notification settings

funatsufumiya/git-lfs-agent-rclone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-lfs-agent-rclone

A custom transfer agent for git-lfs that uses rclone to transfer files. This is useful if you do not want to install a git-lfs server.

Usage

Configure your local git repository as follows

$ git config lfs.standalonetransferagent rclone <1>
$ git config lfs.customtransfer.rclone.path git-lfs-agent-rclone <2>
$ git config lfs.customtransfer.rclone.args $DESTINATION <3>
  1. tell git-lfs to use the transfer agent named "rclone"
  2. tell git-lfs what the name of the program is of the transfer agent
  3. $DESTINATION is the destination to which rclone will copy files tracked by git-lfs when running $ git pull and the place it will store files when running $ git push
  • NOTE: $DESTINATION can be set to anything rclone understands. As an example, source:/home/git/my-lfs-files ships files to a remote server over rclone.

Install

Download pre-built executable binary from Releases page (unzip it and move to /usr/local/bin or C:¥Windows¥System32).

Build

Clone the source and run:

$ cargo build --release # just build
$ cargo install --path . # build and install

Cross build

  • from mac m1, build mac x64
$ rustup target add x86_64-apple-darwin
$ cargo build --release --target=x86_64-apple-darwin

# aarch64
# rustup target add aarch64-apple-darwin
# cargo build --release --target=aarch64-apple-darwin
  • from mac, build linux

see rust-lang/rust#34282 (comment)

$ brew tap SergioBenitez/osxct
$ brew install x86_64-unknown-linux-gnu
$ brew tap messense/macos-cross-toolchains
$ brew install aarch64-unknown-linux-gnu
$ rustup target add x86_64-unknown-linux-gnu
$ rustup target add aarch64-unknown-linux-gnu
$ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-unknown-linux-gnu-gcc cargo build --release --target=x86_64-unknown-linux-gnu

$ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-unknown-linux-gnu-gcc cargo build --release --target=aarch64-unknown-linux-gnu
  • from mac, build windows
$ brew install mingw-w64
$ rustup target add x86_64-pc-windows-gnu
$ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-w64-mingw32-gcc cargo build --release --target=x86_64-pc-windows-gnu

Acknowledgements

This project was created with fork from https://github.com/funatsufumiya/git-lfs-agent-scp, which forked from https://github.com/tdons/git-lfs-agent-scp

About

A custom transfer agent for git-lfs that uses rclone to transfer files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published