Reference
Every export from git-edge.
import { /* ... */ } from 'git-edge';Merge
threeWayMergethreeWayMerge(repo: Repo, sourceRef: string, targetRef: string, opts?: MergeOpts): Promise<MergeResult>| Parameter | Type | Description |
|---|---|---|
opts.message? | string | Default `Merge ${sourceRef} into ${targetRef}`. |
opts.authorName? | string | Default "Git Edge". |
opts.authorEmail? | string | Default "git-edge@local". |
Returns: Promise<{ commitOid: string }>
Object-level three-way merge — no worktree. Throws GitMergeConflictError
on unresolved content conflicts. See
Three-way merge for the full decision
tree.
Parsed-object cache
createParsedObjectCachecreateParsedObjectCache(options?: ParsedObjectCacheOptions): ParsedObjectStore| Parameter | Type | Description |
|---|---|---|
options.maxSize? | number | Approximate byte budget; each entry is sized by walking its value (no serialization). Default 256 MiB. |
options.ttl? | number | Entry TTL in ms. Default 1 hour. |
Returns: ParsedObjectStore
A generic in-memory LRU for any JS value, keyed however you like. See the parsed-object cache guide.
ParsedObjectStore — the returned interface:
interface ParsedObjectStore {
get<T extends object>(key: string): T | null;
set<T extends object>(key: string, value: T): void;
delete(key: string): void;
invalidatePrefix(prefix: string): void;
}Repo cache
getRepoCachegetRepoCache(ownerKey: string, repoName: string): objectReturns: object
The long-lived isomorphic-git packfile cache for a repo, created on
first access. See
Repo cache.
invalidateRepoCacheinvalidateRepoCache(ownerKey: string, repoName: string): voidDrops a repo's cached packfile state — call after any out-of-process storage rewrite.
Errors
class GitMergeConflictError extends GitEdgeErrorThrown only by threeWayMerge. Carries conflictingPaths: string[].
git-edge's error hierarchy is separate from git-fs-s3's —
if you compose the two packages and want a single instanceof check
across both, catch each package's error classes explicitly rather than
assuming a shared base class.
Types
| Export | Shape |
|---|---|
Repo | { fs: IsoGitFs; gitdir: string; cache?: object } |
MergeOpts | { message?, authorName?, authorEmail? } |
MergeResult | { commitOid: string } |
ParsedObjectCacheOptions | { maxSize?: number; ttl?: number } |