Skip to main content

git-lfs-http-mirror

Python wrapper for git that allows it to read a GET-only HTTP mirror of repositories that use Large File Storage (LFS). It effectively extends git's so-called dumb git protocol with the capability to serve LFS files.

This means you can use S3 to host mirrors of LFS repositories, without additional infrastructure. However, no authentication mechanism is currently supported. From the point of view of the calling code, it must be a publically readable bucket.

It works by temporarily firing up an LFS server during the lifetime of the git command.

Installation

pip install git-lfs-http-mirror

Usage

Configuration is by command line arguments

python -m git_lfs_http_mirror
    --upstream-root 'https://my-bucket.s3.eu-west-2.amazonaws.com/a-folder'
    --bind '127.0.0.1:8080'
    -- git clone http://127.0.0.1:8080/my-repo

You can make this slightly less verbose my making a wrapper bash script. If the below is in an executable file glfsm in your PATH

#!/usr/bin/env bash

exec python -m git_lfs_http_mirror \
    --upstream-root 'https://my-bucket.s3.eu-west-2.amazonaws.com/a-folder' \
    --bind '127.0.0.1:8080' \
    $@

then you can call

glfsm -- git clone http://127.0.0.1:8080/my-repo

The server configued as upstream_root should be a static server, serving copies of git repositories, for example S3. Each copy can be created using:

git clone --bare https://server.test/my-repo
cd my-repo.git
git lfs fetch
git update-server-info

and then uploaded to the server in its own folder. If the server is S3, this can be done using the Upload folder feature in the AWS S3 Console.

Metadata

Release files for git-lfs-http-mirror 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-lfs-http-mirror 0.0.7
File Size Uploaded Provenance
git_lfs_http_mirror-0.0.7.tar.gz 4.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for git-lfs-http-mirror 0.0.7
File Interpreter ABI Platform
git_lfs_http_mirror-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 9.3 kB

Release files / git_lfs_http_mirror-0.0.7.tar.gz

Download URL git_lfs_http_mirror-0.0.7.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b1cc5841f679f2732b22e331b5fc9fe1635185e63ccb0507aab23c6ba0bfde79
BLAKE2b-256 checksum
How to use checksums
5a582ad19c0b4f7851ce072f26f219bb76f0f02c93e67900f86c91dbfb29a934
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / git_lfs_http_mirror-0.0.7-py3-none-any.whl

Download URL git_lfs_http_mirror-0.0.7-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbc603ddfbe5f9ff9615304ceddbdb78f866e1a96621b01562a3988a8647275c
BLAKE2b-256 checksum
How to use checksums
39a9ec133f8dfaebf5027d51118b23f5d119744376e30e1551af2df1d9749ae9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.8

Security for git-lfs-http-mirror 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page