git init my-project
cd my-project
git-sfs initEdit .git-sfs/config.toml and set the remote.
git add .git-sfs/config.toml .gitignore
git commit -m "initialize git-sfs"git-sfs add data/train-000.tar.zst
git add data/train-000.tar.zst
git commit -m "track train shard"
git-sfs pushgit-sfs add data/
git add data/
git commit -m "track dataset"
git-sfs pushUse git-sfs import when a file or tree already exists outside the repository and is too large to copy into place first:
git-sfs import /mnt/incoming/dataset data/dataset
git add data/dataset
git commit -m "track imported dataset"
git-sfs pushThe command moves bytes into the cache and leaves symlinks under data/dataset. When the source and cache are on the same filesystem this uses rename; across filesystems it falls back to copy-verify-remove.
If the source path or files inside the source tree are symlinks, pass -L to
resolve them and import the files they point at:
git-sfs import -L /mnt/incoming/dataset data/datasetgit clone <repo>
cd <repo>
git-sfs setup
git-sfs pull
git-sfs verifygit-sfs pull data/train-000.tar.zstOnly the cached file required by that Git symlink is downloaded.
git-sfs pull data/train/Only files referenced by symlinks under that directory are downloaded.
git-sfs setup --cache /mnt/shared/git-sfs-cacheMultiple clones can use the same cache path if filesystem permissions allow it.
rm -f .git-sfs/cache
git-sfs setup --cache /new/cache/path
git-sfs pullgit-sfs setup
git-sfs verifysetup recreates .git-sfs/cache when the binding is missing. If the binding
already exists, it is preserved.
rm -rf .git-sfs/cache
git-sfs setup --cache /mnt/shared/git-sfs-cache
git-sfs verifygit-sfs pull
git-sfs verifyIf the remote has the files, missing cached files are downloaded again.
git-sfs setup
git-sfs verifyBind the CI cache once, then run normal commands through .git-sfs/cache:
git-sfs setup --cache "$PWD/.git-sfs-cache"
git-sfs verifygit-sfs add data/
git add data/
git commit -m "update dataset"
git-sfs push
git-sfs verify data/git status
git diff --cached --stat
find data -type l -maxdepth 2 -printGit should show symlinks and config, not large file bytes.
git-sfs setupsetup repairs the local cache binding and leaves cached bytes in place.
Define the remote in rclone's config, then reference it by name in
.git-sfs/config.toml. The backend type, credentials, and connection settings
live entirely in rclone — git-sfs only needs the remote name and the path within
it.
Example rclone config (~/.config/rclone/rclone.conf):
[myremote]
type = s3
provider = AWS
region = us-east-1Corresponding git-sfs config:
[remotes.default]
backend = "myremote"
path = "datasets/project"Omit config to use rclone's default config. Machine-local credentials stay in
each user's own rclone config.
git-sfs push
git-sfs pull