Lightweight bash script for Git Large File Storage (LFS)
over SSH.
This is a self-contained bash script designed for seamless installation, requiring no prerequisites.
It enables to use git-lfs
even if you can not use http/https but ssh only.
Copy git-lfs-agent-scp.sh
into a directory included in your $PATH
environment variable.
Ensure that the script has the necessary permissions to be executed.
chmod +x git-lfs-agent-scp.sh
Configure your local git repository as follows
$ git config lfs.standalonetransferagent scp
$ git config lfs.customtransfer.scp.path git-lfs-agent-scp.sh
$ git config lfs.customtransfer.scp.args $DESTINATION
$DESTINATION
is a remote pathname to store the files. $DESTINATION
can be set in the form [user@]host:[path]
. For examples,
[email protected]:/path/to/the/directory
.
git-lfs-agent-scp.sh
will invoke scp file $DESTINATION
for upload
and scp $DESTINATION file
for download internally.
If you encounter any issues, you can enable debugging by using GIT_TRACE=1
as follows:
GIT_TRACE=1 git <command>
Replace <command>
with operations like pull or push.
This will provide additional information to help diagnose and resolve problems.
This script was inspired by the following open source projects. Special thanks for their invaluable contributions!!