Expand description
Resolve the LFS server endpoint for a repo.
Implements the priority chain documented in
docs/api/server-discovery.md, plus the SSH/git URL → HTTPS rewriting
upstream does so a git@github.com:foo/bar.git remote yields the
expected https://github.com/foo/bar.git/info/lfs endpoint.
§Priority order
GIT_LFS_URLenvironment variable (matches upstream’s escape hatch).lfs.urlfrom git config — local → global → system →.lfsconfig.remote.<name>.lfsurl(same scopes as above).remote.<name>.urlrewritten viaderive_lfs_url.
<name> defaults to origin when the caller hasn’t passed a remote.
§SSH-style URLs
git lfs itself only speaks HTTP(S); for SSH remotes the protocol is
still HTTPS, just inferred from the remote’s host/path. Upstream also
supports the git-lfs-authenticate SSH command for handing back a
token; that’s deferred (see NOTES.md).
Enums§
Functions§
- derive_
lfs_ url - Convert a clone URL into the matching LFS endpoint URL.
- endpoint_
for_ remote - Resolve the LFS endpoint URL for
cwd+remote. PassNonefor the default (origin, with a “single remote” fallback when origin doesn’t exist and exactly one other remote does).