Construct a repository from live content — a media library, today.
This is not a simulated repository. Git object identity is content addressing, so hashing a file hierarchy produces a genuine tree in the same sha space as every real repo, one that no forge happens to store. A file present in both a media library and a git repository hashes to the same blob sha.
A constructed repository has no history, so log, diff and show refuse and the corresponding AI
tools are never offered for it.
const files = B.find.baseRecord(recordId).recordFiles();
const repo = B.git.repo.from(files, { alias: "casefiles", onNonText: "skip" });
The live content to snapshot.
Optionaloptions: GitSnapshotOptions
Alias, subtree, and non-text policy.
Mount a repository that already exists, pinned to one commit.
An in-cluster repository names a purpose and a repo; its organization is derived from the calling
user's tenant and is never supplied, so reaching another tenant is not refused but unsayable. An
external repository names a url and a credential, where the credential names a Relate secret field
rather than dereferencing one — the plaintext never becomes a script value.
const scripts = B.git.repo.open({ purpose: "script", repo: "100001___200002", ref: "master" });
const policies = B.git.repo.open({
url: "https://github.com/owner/clinical-policies",
forge: "github",
credential: { field: conn.fields.githubPat },
ref: "main",
pathPrefix: "published/",
});
Which repository, at which ref, scoped how.
Constructors for mounted git repositories, on
B.git.repo.open(spec)connects to a repository that exists;from(source, options)constructs one from live content.