type-git 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +3 -6
  2. package/dist/adapters/bun/index.cjs +395 -0
  3. package/dist/adapters/bun/index.cjs.map +1 -0
  4. package/dist/adapters/bun/index.d.cts +44 -0
  5. package/dist/adapters/bun/index.d.ts +38 -5
  6. package/dist/adapters/bun/index.js +362 -13
  7. package/dist/adapters/bun/index.js.map +1 -1
  8. package/dist/adapters/deno/index.cjs +443 -0
  9. package/dist/adapters/deno/index.cjs.map +1 -0
  10. package/dist/adapters/deno/index.d.cts +46 -0
  11. package/dist/adapters/deno/index.d.ts +40 -5
  12. package/dist/adapters/deno/index.js +410 -13
  13. package/dist/adapters/deno/index.js.map +1 -1
  14. package/dist/adapters/node/index.cjs +5625 -0
  15. package/dist/adapters/node/index.cjs.map +1 -0
  16. package/dist/adapters/node/index.d.cts +2 -0
  17. package/dist/adapters/node/index.d.ts +2 -61
  18. package/dist/adapters/node/index.js +5577 -68
  19. package/dist/adapters/node/index.js.map +1 -1
  20. package/dist/{core/types.d.ts → adapters-w9tZ_Qbd.d.cts} +225 -29
  21. package/dist/adapters-w9tZ_Qbd.d.ts +572 -0
  22. package/dist/index-D9acU30I.d.ts +3649 -0
  23. package/dist/index-DRd85eN5.d.cts +3649 -0
  24. package/dist/index.cjs +5744 -0
  25. package/dist/index.cjs.map +1 -0
  26. package/dist/index.d.cts +208 -0
  27. package/dist/index.d.ts +206 -7
  28. package/dist/index.js +5685 -13
  29. package/dist/index.js.map +1 -1
  30. package/package.json +19 -8
  31. package/dist/adapters/bun/exec.d.ts +0 -13
  32. package/dist/adapters/bun/exec.d.ts.map +0 -1
  33. package/dist/adapters/bun/exec.js +0 -242
  34. package/dist/adapters/bun/exec.js.map +0 -1
  35. package/dist/adapters/bun/fs.d.ts +0 -20
  36. package/dist/adapters/bun/fs.d.ts.map +0 -1
  37. package/dist/adapters/bun/fs.js +0 -148
  38. package/dist/adapters/bun/fs.js.map +0 -1
  39. package/dist/adapters/bun/index.d.ts.map +0 -1
  40. package/dist/adapters/deno/exec.d.ts +0 -14
  41. package/dist/adapters/deno/exec.d.ts.map +0 -1
  42. package/dist/adapters/deno/exec.js +0 -266
  43. package/dist/adapters/deno/exec.js.map +0 -1
  44. package/dist/adapters/deno/fs.d.ts +0 -21
  45. package/dist/adapters/deno/fs.d.ts.map +0 -1
  46. package/dist/adapters/deno/fs.js +0 -191
  47. package/dist/adapters/deno/fs.js.map +0 -1
  48. package/dist/adapters/deno/index.d.ts.map +0 -1
  49. package/dist/adapters/node/exec.d.ts +0 -11
  50. package/dist/adapters/node/exec.d.ts.map +0 -1
  51. package/dist/adapters/node/exec.js +0 -161
  52. package/dist/adapters/node/exec.js.map +0 -1
  53. package/dist/adapters/node/fs.d.ts +0 -18
  54. package/dist/adapters/node/fs.d.ts.map +0 -1
  55. package/dist/adapters/node/fs.js +0 -164
  56. package/dist/adapters/node/fs.js.map +0 -1
  57. package/dist/adapters/node/index.d.ts.map +0 -1
  58. package/dist/core/adapters.d.ts +0 -192
  59. package/dist/core/adapters.d.ts.map +0 -1
  60. package/dist/core/adapters.js +0 -10
  61. package/dist/core/adapters.js.map +0 -1
  62. package/dist/core/git.d.ts +0 -160
  63. package/dist/core/git.d.ts.map +0 -1
  64. package/dist/core/git.js +0 -5
  65. package/dist/core/git.js.map +0 -1
  66. package/dist/core/index.d.ts +0 -8
  67. package/dist/core/index.d.ts.map +0 -1
  68. package/dist/core/index.js +0 -8
  69. package/dist/core/index.js.map +0 -1
  70. package/dist/core/repo.d.ts +0 -1275
  71. package/dist/core/repo.d.ts.map +0 -1
  72. package/dist/core/repo.js +0 -5
  73. package/dist/core/repo.js.map +0 -1
  74. package/dist/core/types.d.ts.map +0 -1
  75. package/dist/core/types.js +0 -100
  76. package/dist/core/types.js.map +0 -1
  77. package/dist/impl/bare-repo-impl.d.ts +0 -72
  78. package/dist/impl/bare-repo-impl.d.ts.map +0 -1
  79. package/dist/impl/bare-repo-impl.js +0 -328
  80. package/dist/impl/bare-repo-impl.js.map +0 -1
  81. package/dist/impl/git-impl.d.ts +0 -92
  82. package/dist/impl/git-impl.d.ts.map +0 -1
  83. package/dist/impl/git-impl.js +0 -350
  84. package/dist/impl/git-impl.js.map +0 -1
  85. package/dist/impl/index.d.ts +0 -7
  86. package/dist/impl/index.d.ts.map +0 -1
  87. package/dist/impl/index.js +0 -7
  88. package/dist/impl/index.js.map +0 -1
  89. package/dist/impl/worktree-repo-impl.d.ts +0 -180
  90. package/dist/impl/worktree-repo-impl.d.ts.map +0 -1
  91. package/dist/impl/worktree-repo-impl.js +0 -1931
  92. package/dist/impl/worktree-repo-impl.js.map +0 -1
  93. package/dist/index.d.ts.map +0 -1
  94. package/dist/parsers/index.d.ts +0 -230
  95. package/dist/parsers/index.d.ts.map +0 -1
  96. package/dist/parsers/index.js +0 -529
  97. package/dist/parsers/index.js.map +0 -1
  98. package/dist/runner/cli-runner.d.ts +0 -94
  99. package/dist/runner/cli-runner.d.ts.map +0 -1
  100. package/dist/runner/cli-runner.js +0 -315
  101. package/dist/runner/cli-runner.js.map +0 -1
  102. package/dist/runner/index.d.ts +0 -5
  103. package/dist/runner/index.d.ts.map +0 -1
  104. package/dist/runner/index.js +0 -5
  105. package/dist/runner/index.js.map +0 -1
@@ -0,0 +1,3649 @@
1
+ import { f as ExecOpts, g as RawResult, m as LfsMode, e as GitProgress, q as GitOpenOptions, R as RuntimeAdapters, p as ExecutionContext, j as GitError, E as ExecAdapter, C as Capabilities, S as SpawnOptions, b as StreamHandler, a as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle } from './adapters-w9tZ_Qbd.cjs';
2
+
3
+ /**
4
+ * Repository interfaces - operations that require a repository context
5
+ */
6
+
7
+ /**
8
+ * Base repository interface
9
+ */
10
+ interface RepoBase {
11
+ /**
12
+ * Execute a raw git command in this repository context
13
+ *
14
+ * Wraps: `git <argv...>`
15
+ */
16
+ raw(argv: string[], opts?: ExecOpts): Promise<RawResult>;
17
+ /**
18
+ * Check if this repository is a worktree repository (has working directory)
19
+ *
20
+ * Wraps: `git rev-parse --is-inside-work-tree`
21
+ *
22
+ * This is a runtime check that queries git to determine the repository type.
23
+ * Note: TypeScript cannot automatically narrow the type based on this check
24
+ * since it returns `Promise<boolean>`. Use type assertions after checking.
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * const repo = await git.openRaw('/path/to/repo');
29
+ * if (await repo.isWorktree()) {
30
+ * // Use type assertion to access WorktreeRepo methods
31
+ * const status = await (repo as WorktreeRepo).status();
32
+ * }
33
+ * ```
34
+ */
35
+ isWorktree(): Promise<boolean>;
36
+ /**
37
+ * Check if this repository is a bare repository (no working directory)
38
+ *
39
+ * Wraps: `git rev-parse --is-bare-repository`
40
+ *
41
+ * This is a runtime check that queries git to determine the repository type.
42
+ * Note: TypeScript cannot automatically narrow the type based on this check
43
+ * since it returns `Promise<boolean>`. Use type assertions after checking.
44
+ *
45
+ * @example
46
+ * ```typescript
47
+ * const repo = await git.openRaw('/path/to/repo');
48
+ * if (await repo.isBare()) {
49
+ * // Use type assertion to access BareRepo methods
50
+ * await (repo as BareRepo).fetch({ remote: 'origin' });
51
+ * }
52
+ * ```
53
+ */
54
+ isBare(): Promise<boolean>;
55
+ }
56
+ /**
57
+ * Status file entry
58
+ */
59
+ type StatusEntry = {
60
+ path: string;
61
+ index: string;
62
+ workdir: string;
63
+ originalPath?: string;
64
+ };
65
+ /**
66
+ * Result from git status --porcelain
67
+ */
68
+ type StatusPorcelain = {
69
+ entries: StatusEntry[];
70
+ branch?: string;
71
+ upstream?: string;
72
+ ahead?: number;
73
+ behind?: number;
74
+ };
75
+ /**
76
+ * Options for git status
77
+ */
78
+ type StatusOpts = {
79
+ /** Porcelain output format version (1 or 2) */
80
+ porcelain?: 1 | 2;
81
+ /** How to show untracked files */
82
+ untracked?: 'no' | 'normal' | 'all';
83
+ /** Give the output in verbose format */
84
+ verbose?: boolean;
85
+ /** Show stash information */
86
+ showStash?: boolean;
87
+ /** Compute ahead/behind counts for the branch */
88
+ aheadBehind?: boolean;
89
+ /** Use NUL as line terminator */
90
+ nullTerminated?: boolean;
91
+ /** How to show ignored files */
92
+ ignored?: 'traditional' | 'no' | 'matching';
93
+ /** How to handle submodules */
94
+ ignoreSubmodules?: 'none' | 'untracked' | 'dirty' | 'all';
95
+ /** Do not detect renames */
96
+ noRenames?: boolean;
97
+ /** Detect renames (optionally with similarity threshold) */
98
+ findRenames?: boolean | number;
99
+ };
100
+ /**
101
+ * Commit information
102
+ */
103
+ type Commit = {
104
+ hash: string;
105
+ abbrevHash: string;
106
+ parents: string[];
107
+ author: {
108
+ name: string;
109
+ email: string;
110
+ timestamp: number;
111
+ };
112
+ committer: {
113
+ name: string;
114
+ email: string;
115
+ timestamp: number;
116
+ };
117
+ subject: string;
118
+ body: string;
119
+ };
120
+ /**
121
+ * Options for git log
122
+ */
123
+ type LogOpts = {
124
+ /** Limit the number of commits to output */
125
+ maxCount?: number;
126
+ /** Skip number of commits before starting to show the output */
127
+ skip?: number;
128
+ /** Show commits more recent than a specific date */
129
+ since?: string | Date;
130
+ /** Show commits older than a specific date */
131
+ until?: string | Date;
132
+ /** Limit commits to those by a specific author */
133
+ author?: string;
134
+ /** Limit commits to those with log message matching the pattern */
135
+ grep?: string;
136
+ /** Pretend as if all refs are listed on the command line */
137
+ all?: boolean;
138
+ /** Follow only the first parent commit upon seeing a merge commit */
139
+ firstParent?: boolean;
140
+ /** Print out the ref name given on the command line by which each commit was reached */
141
+ source?: boolean;
142
+ /** Use mailmap file to map author names */
143
+ useMailmap?: boolean;
144
+ /** If no --decorate-refs is given, pretend as if all refs were included */
145
+ decorateRefs?: string;
146
+ /** Do not include refs matching the pattern */
147
+ decorateRefsExclude?: string;
148
+ /** Print out the ref names of any commits that are shown */
149
+ decorate?: 'short' | 'full' | 'auto' | 'no';
150
+ /** Generate a diffstat */
151
+ stat?: boolean;
152
+ /** Output only the last line of the stat */
153
+ shortstat?: boolean;
154
+ /** Show only names of changed files */
155
+ nameOnly?: boolean;
156
+ /** Show only names and status of changed files */
157
+ nameStatus?: boolean;
158
+ /** Show only merge commits */
159
+ merges?: boolean;
160
+ /** Do not show merge commits */
161
+ noMerges?: boolean;
162
+ /** Only display commits that are ancestors of the specified commit */
163
+ ancestryPath?: boolean;
164
+ /** Output commits in reverse order */
165
+ reverse?: boolean;
166
+ /** Alias for since */
167
+ after?: string | Date;
168
+ /** Alias for until */
169
+ before?: string | Date;
170
+ /** Revision or revision range to show (e.g., 'main', 'HEAD~5..HEAD', 'v1.0.0') */
171
+ ref?: string;
172
+ };
173
+ /**
174
+ * Options for git fetch
175
+ */
176
+ type FetchOpts = {
177
+ /** Remote name to fetch from */
178
+ remote?: string;
179
+ /** Refspec(s) to fetch */
180
+ refspec?: string | string[];
181
+ /** Remove remote-tracking refs that no longer exist on the remote */
182
+ prune?: boolean;
183
+ /** Fetch all tags from the remote */
184
+ tags?: boolean;
185
+ /** Limit fetching to the specified number of commits */
186
+ depth?: number;
187
+ /** Be more verbose */
188
+ verbose?: boolean;
189
+ /** Operate quietly (suppress progress reporting) */
190
+ quiet?: boolean;
191
+ /** Fetch from all remotes */
192
+ all?: boolean;
193
+ /** Set upstream tracking for the fetched branches */
194
+ setUpstream?: boolean;
195
+ /** Append ref names and object names of fetched refs to .git/FETCH_HEAD */
196
+ append?: boolean;
197
+ /** Use atomic transaction to update refs */
198
+ atomic?: boolean;
199
+ /** Force update of local branches */
200
+ force?: boolean;
201
+ /** Allow fetching from multiple remotes */
202
+ multiple?: boolean;
203
+ /** Do not fetch any tags */
204
+ noTags?: boolean;
205
+ /** Number of parallel children for fetching submodules */
206
+ jobs?: number;
207
+ /** Modify the configured refspec to place all refs into refs/prefetch/ */
208
+ prefetch?: boolean;
209
+ /** Also prune tags that are no longer on the remote */
210
+ pruneTags?: boolean;
211
+ /** Fetch submodules recursively */
212
+ recurseSubmodules?: boolean | 'yes' | 'on-demand' | 'no';
213
+ /** Dry run - show what would be done without making changes */
214
+ dryRun?: boolean;
215
+ /** Allow updating FETCH_HEAD */
216
+ writeFetchHead?: boolean;
217
+ /** Keep downloaded pack */
218
+ keep?: boolean;
219
+ /** Allow updating the current branch head */
220
+ updateHeadOk?: boolean;
221
+ /** Deepen a shallow repository by date */
222
+ shallowSince?: string | Date;
223
+ /** Deepen a shallow repository excluding specified revision */
224
+ shallowExclude?: string | string[];
225
+ /** Deepen a shallow repository by specified number of commits */
226
+ deepen?: number;
227
+ /** Convert a shallow repository to a complete one */
228
+ unshallow?: boolean;
229
+ /** Re-fetch all objects even if we already have them */
230
+ refetch?: boolean;
231
+ /** Update shallow boundary if new refs need it */
232
+ updateShallow?: boolean;
233
+ /** Override the default refspec */
234
+ refmap?: string;
235
+ /** Use IPv4 addresses only */
236
+ ipv4?: boolean;
237
+ /** Use IPv6 addresses only */
238
+ ipv6?: boolean;
239
+ /** Partial clone filter specification */
240
+ filter?: string;
241
+ /** Check for forced updates */
242
+ showForcedUpdates?: boolean;
243
+ /** Write commit graph after fetching */
244
+ writeCommitGraph?: boolean;
245
+ };
246
+ /**
247
+ * Force with lease options for git push
248
+ */
249
+ type ForceWithLeaseOpts = {
250
+ /** Reference name to check (e.g., 'refs/heads/main') */
251
+ refname: string;
252
+ /** Expected value of the ref (commit hash) */
253
+ expect?: string;
254
+ };
255
+ /**
256
+ * Options for git push
257
+ */
258
+ type PushOpts = {
259
+ /** Remote name to push to */
260
+ remote?: string;
261
+ /** Refspec(s) to push */
262
+ refspec?: string | string[];
263
+ /** Force updates even if they are not fast-forward */
264
+ force?: boolean;
265
+ /**
266
+ * Force with lease - safer force push that fails if remote has been updated
267
+ * - true: use default behavior (check current remote ref)
268
+ * - ForceWithLeaseOpts: specify refname and optional expected value
269
+ */
270
+ forceWithLease?: boolean | ForceWithLeaseOpts;
271
+ /** Push all tags */
272
+ tags?: boolean;
273
+ /** Set upstream tracking for the pushed branches */
274
+ setUpstream?: boolean;
275
+ /** Bypass pre-push hook */
276
+ noVerify?: boolean;
277
+ /**
278
+ * GPG-sign the push (for signed pushes)
279
+ * - true: sign with default key
280
+ * - 'if-asked': sign only if server supports and requests it
281
+ */
282
+ signed?: boolean | 'if-asked';
283
+ /** Be more verbose */
284
+ verbose?: boolean;
285
+ /** Operate quietly (suppress progress reporting) */
286
+ quiet?: boolean;
287
+ /** Override the default repository */
288
+ repo?: string;
289
+ /** Push all branches */
290
+ all?: boolean;
291
+ /** Push all branches (alias for all) */
292
+ branches?: boolean;
293
+ /** Mirror mode - push all refs */
294
+ mirror?: boolean;
295
+ /** Delete the specified refs from the remote */
296
+ deleteRefs?: boolean;
297
+ /** Dry run - show what would be pushed without pushing */
298
+ dryRun?: boolean;
299
+ /** Force only if the remote tip is included in local history */
300
+ forceIfIncludes?: boolean;
301
+ /** Push submodules recursively */
302
+ recurseSubmodules?: 'check' | 'on-demand' | 'only' | 'no';
303
+ /** Use thin pack transfer */
304
+ thin?: boolean;
305
+ /** Prune remote-tracking branches that are deleted locally */
306
+ prune?: boolean;
307
+ /** Push all refs under refs/tags with the commits */
308
+ followTags?: boolean;
309
+ /** Use atomic transaction to update refs */
310
+ atomic?: boolean;
311
+ /** Transmit push options to the server */
312
+ pushOption?: string | string[];
313
+ /** Use IPv4 addresses only */
314
+ ipv4?: boolean;
315
+ /** Use IPv6 addresses only */
316
+ ipv6?: boolean;
317
+ };
318
+ /**
319
+ * Options for git add
320
+ */
321
+ type AddOpts = {
322
+ /** Add all files (including untracked) */
323
+ all?: boolean;
324
+ /** Dry run - show what would be added */
325
+ dryRun?: boolean;
326
+ /** Add modified and deleted files, but not untracked */
327
+ update?: boolean;
328
+ /** Force add of ignored files */
329
+ force?: boolean;
330
+ /** Add changes interactively (not supported - use raw) */
331
+ interactive?: never;
332
+ /** Add changes in patch mode (not supported - use raw) */
333
+ patch?: never;
334
+ /** Be verbose */
335
+ verbose?: boolean;
336
+ /** Record only the fact that the path will be added later */
337
+ intentToAdd?: boolean;
338
+ /** Apply the clean process freshly to all tracked files */
339
+ renormalize?: boolean;
340
+ /** Ignore removal of files from working tree */
341
+ ignoreRemoval?: boolean;
342
+ /** Don't add files, just refresh their stat info in the index */
343
+ refresh?: boolean;
344
+ /** If some files could not be added, continue adding others */
345
+ ignoreErrors?: boolean;
346
+ /** Don't report missing files (with --dry-run) */
347
+ ignoreMissing?: boolean;
348
+ /** Allow updating index entries outside of sparse-checkout cone */
349
+ sparse?: boolean;
350
+ /** Override the executable bit of the listed files */
351
+ chmod?: '+x' | '-x';
352
+ /** Read pathspecs from file instead of command line */
353
+ pathspecFromFile?: string;
354
+ };
355
+ /**
356
+ * Branch information
357
+ */
358
+ type BranchInfo = {
359
+ name: string;
360
+ current: boolean;
361
+ commit: string;
362
+ upstream?: string;
363
+ gone?: boolean;
364
+ };
365
+ /**
366
+ * Options for git branch
367
+ */
368
+ type BranchOpts = {
369
+ /** List all branches (including remote) */
370
+ all?: boolean;
371
+ /** List remote branches only */
372
+ remotes?: boolean;
373
+ /** Show verbose info */
374
+ verbose?: boolean;
375
+ /** Suppress informational messages */
376
+ quiet?: boolean;
377
+ /** Only list branches that contain the specified commit */
378
+ contains?: string;
379
+ /** Only list branches that don't contain the specified commit */
380
+ noContains?: string;
381
+ /** Abbreviate object names to specified length */
382
+ abbrev?: number;
383
+ /** Only list branches whose tips are reachable from the specified commit */
384
+ merged?: string;
385
+ /** Only list branches whose tips are not reachable from the specified commit */
386
+ noMerged?: string;
387
+ /** Sorting key (e.g., -committerdate, refname) */
388
+ sort?: string;
389
+ /** Only list branches that point at the specified object */
390
+ pointsAt?: string;
391
+ /** Sorting and filtering are case insensitive */
392
+ ignoreCase?: boolean;
393
+ };
394
+ /**
395
+ * Options for creating a branch
396
+ */
397
+ type BranchCreateOpts = {
398
+ /** Start point (commit, branch, or tag) */
399
+ startPoint?: string;
400
+ /** Force creation (overwrite existing) */
401
+ force?: boolean;
402
+ /** Set up tracking */
403
+ track?: boolean;
404
+ /** Set up upstream configuration for the new branch */
405
+ setUpstreamTo?: string;
406
+ /** Create the branch's reflog */
407
+ createReflog?: boolean;
408
+ /** Also update submodules */
409
+ recurseSubmodules?: boolean;
410
+ };
411
+ /**
412
+ * Options for deleting a branch
413
+ */
414
+ type BranchDeleteOpts = {
415
+ /** Force delete (even if not merged) */
416
+ force?: boolean;
417
+ /** Delete remote-tracking branch */
418
+ remote?: boolean;
419
+ };
420
+ /**
421
+ * Options for git checkout (branch switching mode)
422
+ *
423
+ * Used for: `git checkout <branch>`
424
+ */
425
+ type CheckoutBranchOpts = {
426
+ /** Force checkout (discard local changes) */
427
+ force?: boolean;
428
+ /** Create new branch */
429
+ createBranch?: boolean;
430
+ /** Start point for new branch */
431
+ startPoint?: string;
432
+ /** Track remote branch */
433
+ track?: boolean;
434
+ /** Create or reset and checkout branch (like -b but forces) */
435
+ forceCreateBranch?: boolean;
436
+ /** Create reflog for new branch */
437
+ createReflog?: boolean;
438
+ /** Try to guess remote tracking branch if target not found */
439
+ guess?: boolean;
440
+ /** Suppress progress reporting */
441
+ quiet?: boolean;
442
+ /** Update submodules */
443
+ recurseSubmodules?: boolean;
444
+ /** Merge local modifications with the new branch */
445
+ merge?: boolean;
446
+ /** Conflict style for merge conflicts */
447
+ conflict?: 'merge' | 'diff3' | 'zdiff3';
448
+ /** Detach HEAD at specified commit */
449
+ detach?: boolean;
450
+ /** Create new orphan branch */
451
+ orphan?: boolean;
452
+ /** Silently overwrite ignored files */
453
+ overwriteIgnore?: boolean;
454
+ /** Ignore if branch is checked out in other worktrees */
455
+ ignoreOtherWorktrees?: boolean;
456
+ };
457
+ /**
458
+ * Options for git checkout (pathspec mode)
459
+ *
460
+ * Used for: `git checkout [<tree-ish>] -- <pathspec>...`
461
+ */
462
+ type CheckoutPathOpts = {
463
+ /** Force checkout (discard local changes) */
464
+ force?: boolean;
465
+ /** Source tree-ish to checkout from (default: index) */
466
+ source?: string;
467
+ /** Suppress progress reporting */
468
+ quiet?: boolean;
469
+ /** Allow overlapping paths when checking out from tree-ish */
470
+ overlay?: boolean;
471
+ /** Check out 'our' version for unmerged files */
472
+ ours?: boolean;
473
+ /** Check out 'their' version for unmerged files */
474
+ theirs?: boolean;
475
+ /** Read pathspecs from file instead of command line */
476
+ pathspecFromFile?: string;
477
+ };
478
+ /**
479
+ * Options for git checkout (legacy combined type)
480
+ * @deprecated Use CheckoutBranchOpts or CheckoutPathOpts for type safety
481
+ */
482
+ type CheckoutOpts = CheckoutBranchOpts & CheckoutPathOpts;
483
+ /**
484
+ * Options for git commit
485
+ */
486
+ type CommitOpts = {
487
+ /** Commit message */
488
+ message?: string;
489
+ /** Allow empty commit */
490
+ allowEmpty?: boolean;
491
+ /** Amend previous commit */
492
+ amend?: boolean;
493
+ /** Add all tracked modified files */
494
+ all?: boolean;
495
+ /** Author name and email */
496
+ author?: string;
497
+ /** Override commit date */
498
+ date?: string | Date;
499
+ /** Do not create commit, just update message */
500
+ dryRun?: boolean;
501
+ /** Bypass pre-commit and commit-msg hooks */
502
+ noVerify?: boolean;
503
+ /** GPG-sign the commit with the default key */
504
+ gpgSign?: boolean;
505
+ /** Do not GPG-sign the commit (override commit.gpgSign config) */
506
+ noGpgSign?: boolean;
507
+ /** Suppress commit summary message */
508
+ quiet?: boolean;
509
+ /** Show unified diff between HEAD and working tree */
510
+ verbose?: boolean;
511
+ /** Read commit message from file */
512
+ file?: string;
513
+ /** Take existing commit message and re-edit it */
514
+ reeditMessage?: string;
515
+ /** Take existing commit message and reuse it */
516
+ reuseMessage?: string;
517
+ /** Create a fixup commit for the specified commit */
518
+ fixup?: string;
519
+ /** Create a squash commit for the specified commit */
520
+ squash?: string;
521
+ /** Override author date and ignore cached author identity */
522
+ resetAuthor?: boolean;
523
+ /** Add trailers to the commit message */
524
+ trailer?: string | string[];
525
+ /** Add Signed-off-by trailer */
526
+ signoff?: boolean;
527
+ /** How to clean up the commit message */
528
+ cleanup?: 'strip' | 'whitespace' | 'verbatim' | 'scissors' | 'default';
529
+ /** Before committing, also stage specified paths */
530
+ include?: boolean;
531
+ /** Commit only specified paths, ignoring staged changes */
532
+ only?: boolean;
533
+ /** Bypass post-rewrite hook */
534
+ noPostRewrite?: boolean;
535
+ /** How to show untracked files */
536
+ untrackedFiles?: 'no' | 'normal' | 'all';
537
+ /** Read pathspecs from file instead of command line */
538
+ pathspecFromFile?: string;
539
+ /** Allow commit with empty message */
540
+ allowEmptyMessage?: boolean;
541
+ };
542
+ /**
543
+ * Commit result
544
+ */
545
+ type CommitResult = {
546
+ /** Commit hash */
547
+ hash: string;
548
+ /** Branch name */
549
+ branch: string;
550
+ /** Commit message summary */
551
+ summary: string;
552
+ /** Files changed */
553
+ filesChanged: number;
554
+ /** Insertions */
555
+ insertions: number;
556
+ /** Deletions */
557
+ deletions: number;
558
+ };
559
+ /**
560
+ * Options for git diff
561
+ */
562
+ type DiffOpts = {
563
+ /** Compare staged changes */
564
+ staged?: boolean;
565
+ /** Show stat only */
566
+ stat?: boolean;
567
+ /** Show name only */
568
+ nameOnly?: boolean;
569
+ /** Show name and status */
570
+ nameStatus?: boolean;
571
+ /** Number of context lines */
572
+ context?: number;
573
+ /** Ignore whitespace changes */
574
+ ignoreWhitespace?: boolean;
575
+ /** Pathspecs to filter */
576
+ paths?: string[];
577
+ /** Use NUL as line terminator */
578
+ nullTerminated?: boolean;
579
+ /** Generate patch output */
580
+ patch?: boolean;
581
+ /** Generate patch and raw format together */
582
+ patchWithRaw?: boolean;
583
+ /** Show number of added/deleted lines in decimal notation */
584
+ numstat?: boolean;
585
+ /** Generate patch and diffstat together */
586
+ patchWithStat?: boolean;
587
+ /** Show full 40-byte hexadecimal object name in diff */
588
+ fullIndex?: boolean;
589
+ /** Abbreviate object names to specified length */
590
+ abbrev?: number;
591
+ /** Swap two inputs (show reverse diff) */
592
+ reverse?: boolean;
593
+ /** Detect rewrites (optionally with threshold like '50%') */
594
+ detectRewrites?: boolean | string;
595
+ /** Detect renames (optionally with threshold like '50%') */
596
+ detectRenames?: boolean | string;
597
+ /** Detect copies (optionally with threshold like '50%') */
598
+ detectCopies?: boolean | string;
599
+ /** Find copies harder (inspects unmodified files as source) */
600
+ findCopiesHarder?: boolean;
601
+ /** Rename limit threshold */
602
+ renameLimit?: number;
603
+ /** Look for string added/removed in a change (pickaxe) */
604
+ pickaxe?: string;
605
+ /** Show all files that changed, not just those with pickaxe match */
606
+ pickaxeAll?: boolean;
607
+ /** Treat all files as text */
608
+ text?: boolean;
609
+ /** Show changes relative to a merge base */
610
+ mergeBase?: string;
611
+ /** Compare two paths on filesystem (not in repository) */
612
+ noIndex?: boolean;
613
+ /** Show word diff */
614
+ wordDiff?: 'color' | 'plain' | 'porcelain' | 'none';
615
+ };
616
+ /**
617
+ * Diff file entry
618
+ */
619
+ type DiffEntry = {
620
+ path: string;
621
+ status: 'A' | 'D' | 'M' | 'R' | 'C' | 'T' | 'U' | 'X';
622
+ oldPath?: string;
623
+ additions?: number;
624
+ deletions?: number;
625
+ };
626
+ /**
627
+ * Diff result
628
+ */
629
+ type DiffResult = {
630
+ files: DiffEntry[];
631
+ raw?: string;
632
+ };
633
+ /**
634
+ * Options for git merge
635
+ */
636
+ type MergeOpts = {
637
+ /** Merge message */
638
+ message?: string;
639
+ /** Fast-forward behavior */
640
+ ff?: 'only' | 'no' | boolean;
641
+ /** Squash merge */
642
+ squash?: boolean;
643
+ /** No commit after merge */
644
+ noCommit?: boolean;
645
+ /** Strategy to use */
646
+ strategy?: string;
647
+ /** Strategy options */
648
+ strategyOption?: string | string[];
649
+ /** Abort merge */
650
+ abort?: boolean;
651
+ /** Continue merge */
652
+ continue?: boolean;
653
+ /** Bypass pre-merge-commit hook */
654
+ noVerify?: boolean;
655
+ /** Do not show diffstat at end of merge */
656
+ noDiffstat?: boolean;
657
+ /** Show diffstat at end of merge */
658
+ stat?: boolean;
659
+ /** Show compact summary of changed files */
660
+ compactSummary?: boolean;
661
+ /** Add log of commits being merged (optionally with count) */
662
+ log?: boolean | number;
663
+ /** How to clean up the commit message */
664
+ cleanup?: 'strip' | 'whitespace' | 'verbatim' | 'scissors' | 'default';
665
+ /** Automatically update rerere state */
666
+ rerereAutoupdate?: boolean;
667
+ /** Verify that commit is signed with a valid key */
668
+ verifySignatures?: boolean;
669
+ /** Be verbose */
670
+ verbose?: boolean;
671
+ /** Be quiet */
672
+ quiet?: boolean;
673
+ /** Quit the current in-progress merge without cleanup */
674
+ quit?: boolean;
675
+ /** Allow merging histories that do not share a common ancestor */
676
+ allowUnrelatedHistories?: boolean;
677
+ /** GPG-sign the merge commit (optionally with key id) */
678
+ gpgSign?: boolean | string;
679
+ /** Automatically stash before merge and unstash after */
680
+ autostash?: boolean;
681
+ /** Silently overwrite ignored files */
682
+ overwriteIgnore?: boolean;
683
+ /** Add Signed-off-by trailer */
684
+ signoff?: boolean;
685
+ /** Use custom branch name in merge commit message */
686
+ intoName?: string;
687
+ };
688
+ /**
689
+ * Merge result
690
+ */
691
+ type MergeResult = {
692
+ success: boolean;
693
+ hash?: string;
694
+ conflicts?: string[];
695
+ fastForward?: boolean;
696
+ };
697
+ /**
698
+ * Options for git pull
699
+ */
700
+ type PullOpts = {
701
+ /** Remote name */
702
+ remote?: string;
703
+ /** Branch to pull */
704
+ branch?: string;
705
+ /** Rebase instead of merge */
706
+ rebase?: boolean | 'merges' | 'interactive';
707
+ /** Fast-forward behavior */
708
+ ff?: 'only' | 'no' | boolean;
709
+ /** Fetch tags */
710
+ tags?: boolean;
711
+ /** Prune remote-tracking refs */
712
+ prune?: boolean;
713
+ /** Progress callback */
714
+ onProgress?: (progress: GitProgress) => void;
715
+ /** Be verbose */
716
+ verbose?: boolean;
717
+ /** Be quiet */
718
+ quiet?: boolean;
719
+ /** Fetch submodules recursively */
720
+ recurseSubmodules?: boolean | 'yes' | 'on-demand' | 'no';
721
+ /** Do not show diffstat at end of merge */
722
+ noStat?: boolean;
723
+ /** Show diffstat at end of merge */
724
+ stat?: boolean;
725
+ /** Show compact summary of changed files */
726
+ compactSummary?: boolean;
727
+ /** Add log of commits being merged (optionally with count) */
728
+ log?: boolean | number;
729
+ /** Add Signed-off-by trailer */
730
+ signoff?: boolean;
731
+ /** Squash merge */
732
+ squash?: boolean;
733
+ /** Perform merge and commit (or not) */
734
+ commit?: boolean;
735
+ /** How to clean up the commit message */
736
+ cleanup?: string;
737
+ /** Run hooks or not */
738
+ verify?: boolean;
739
+ /** Verify that commit is signed with a valid key */
740
+ verifySignatures?: boolean;
741
+ /** Automatically stash before pull and unstash after */
742
+ autostash?: boolean;
743
+ /** Merge strategy to use */
744
+ strategy?: string;
745
+ /** Strategy options */
746
+ strategyOption?: string | string[];
747
+ /** GPG-sign the merge commit (optionally with key id) */
748
+ gpgSign?: boolean | string;
749
+ /** Allow merging histories that do not share a common ancestor */
750
+ allowUnrelatedHistories?: boolean;
751
+ /** Fetch from all remotes */
752
+ all?: boolean;
753
+ /** Append ref names and object names to FETCH_HEAD */
754
+ append?: boolean;
755
+ /** Force update of local branches */
756
+ force?: boolean;
757
+ /** Number of parallel children for fetching submodules */
758
+ jobs?: number;
759
+ /** Dry run */
760
+ dryRun?: boolean;
761
+ /** Keep downloaded pack */
762
+ keep?: boolean;
763
+ /** Limit fetching depth */
764
+ depth?: number;
765
+ /** Deepen shallow clone since date */
766
+ shallowSince?: string | Date;
767
+ /** Deepen shallow clone excluding revision */
768
+ shallowExclude?: string | string[];
769
+ /** Deepen shallow clone by specified commits */
770
+ deepen?: number;
771
+ /** Convert shallow repository to complete one */
772
+ unshallow?: boolean;
773
+ /** Update shallow boundary if new refs need it */
774
+ updateShallow?: boolean;
775
+ /** Use IPv4 addresses only */
776
+ ipv4?: boolean;
777
+ /** Use IPv6 addresses only */
778
+ ipv6?: boolean;
779
+ /** Set upstream tracking for the current branch */
780
+ setUpstream?: boolean;
781
+ };
782
+ /**
783
+ * Options for git reset
784
+ */
785
+ type ResetOpts = {
786
+ /** Reset mode */
787
+ mode?: 'soft' | 'mixed' | 'hard' | 'merge' | 'keep';
788
+ /** Be quiet (report only errors) */
789
+ quiet?: boolean;
790
+ /** Skip refreshing the index after reset */
791
+ noRefresh?: boolean;
792
+ /** Reset submodules */
793
+ recurseSubmodules?: boolean;
794
+ /** Record intention to add unstaged files */
795
+ intentToAdd?: boolean;
796
+ /** Read pathspecs from file instead of command line */
797
+ pathspecFromFile?: string;
798
+ };
799
+ /**
800
+ * Options for git rm
801
+ */
802
+ type RmOpts = {
803
+ /** Force removal */
804
+ force?: boolean;
805
+ /** Remove from index only (keep in working tree) */
806
+ cached?: boolean;
807
+ /** Allow recursive removal */
808
+ recursive?: boolean;
809
+ /** Dry run */
810
+ dryRun?: boolean;
811
+ /** Suppress output */
812
+ quiet?: boolean;
813
+ /** Exit with zero status even if no files matched */
814
+ ignoreUnmatch?: boolean;
815
+ /** Allow removing files outside of sparse-checkout cone */
816
+ sparse?: boolean;
817
+ /** Read pathspecs from file instead of command line */
818
+ pathspecFromFile?: string;
819
+ };
820
+ /**
821
+ * Stash entry
822
+ */
823
+ type StashEntry = {
824
+ index: number;
825
+ message: string;
826
+ branch?: string;
827
+ commit: string;
828
+ };
829
+ /**
830
+ * Options for git stash push
831
+ */
832
+ type StashPushOpts = {
833
+ /** Stash message */
834
+ message?: string;
835
+ /** Include untracked files */
836
+ includeUntracked?: boolean;
837
+ /** Keep index */
838
+ keepIndex?: boolean;
839
+ /** Specific paths to stash */
840
+ paths?: string[];
841
+ /** Stash only staged changes */
842
+ staged?: boolean;
843
+ /** Suppress output */
844
+ quiet?: boolean;
845
+ /** Stash all files including untracked and ignored */
846
+ all?: boolean;
847
+ /** Read pathspecs from file instead of command line */
848
+ pathspecFromFile?: string;
849
+ };
850
+ /**
851
+ * Options for git stash pop/apply
852
+ */
853
+ type StashApplyOpts = {
854
+ /** Stash index to apply */
855
+ index?: number;
856
+ /** Try to reinstate index */
857
+ reinstateIndex?: boolean;
858
+ };
859
+ /**
860
+ * Options for git switch
861
+ */
862
+ type SwitchOpts = {
863
+ /** Create new branch */
864
+ create?: boolean;
865
+ /** Force create (overwrite existing) */
866
+ forceCreate?: boolean;
867
+ /** Discard local changes */
868
+ discard?: boolean;
869
+ /** Start point for new branch */
870
+ startPoint?: string;
871
+ /** Track remote branch */
872
+ track?: boolean;
873
+ /** Detach HEAD */
874
+ detach?: boolean;
875
+ /** Try to guess remote tracking branch if target not found */
876
+ guess?: boolean;
877
+ /** Suppress progress reporting */
878
+ quiet?: boolean;
879
+ /** Update submodules */
880
+ recurseSubmodules?: boolean;
881
+ /** Merge local modifications with the new branch */
882
+ merge?: boolean;
883
+ /** Conflict style for merge conflicts */
884
+ conflict?: 'merge' | 'diff3' | 'zdiff3';
885
+ /** Force switch (throw away local modifications) */
886
+ force?: boolean;
887
+ /** Create new orphan branch */
888
+ orphan?: boolean;
889
+ /** Silently overwrite ignored files */
890
+ overwriteIgnore?: boolean;
891
+ /** Ignore if branch is checked out in other worktrees */
892
+ ignoreOtherWorktrees?: boolean;
893
+ };
894
+ /**
895
+ * Tag information
896
+ */
897
+ type TagInfo = {
898
+ name: string;
899
+ commit: string;
900
+ message?: string;
901
+ tagger?: {
902
+ name: string;
903
+ email: string;
904
+ date: Date;
905
+ };
906
+ annotated: boolean;
907
+ };
908
+ /**
909
+ * Options for git tag (list)
910
+ */
911
+ type TagListOpts = {
912
+ /** List pattern */
913
+ pattern?: string;
914
+ /** Sort by */
915
+ sort?: string;
916
+ /** Print n lines of tag message */
917
+ lines?: number;
918
+ /** Only list tags that contain the specified commit */
919
+ contains?: string;
920
+ /** Only list tags that don't contain the specified commit */
921
+ noContains?: string;
922
+ /** Only list tags whose tips are reachable from the specified commit */
923
+ merged?: string;
924
+ /** Only list tags whose tips are not reachable from the specified commit */
925
+ noMerged?: string;
926
+ /** Only list tags that point at the specified object */
927
+ pointsAt?: string;
928
+ /** Sorting and filtering are case insensitive */
929
+ ignoreCase?: boolean;
930
+ };
931
+ /**
932
+ * Options for creating a tag
933
+ */
934
+ type TagCreateOpts = {
935
+ /** Tag message (creates annotated tag) */
936
+ message?: string;
937
+ /** Force (overwrite existing tag) */
938
+ force?: boolean;
939
+ /** Commit to tag */
940
+ commit?: string;
941
+ /** GPG-sign the tag with the default key */
942
+ sign?: boolean;
943
+ /** Read tag message from file */
944
+ file?: string;
945
+ /** Add trailers to the tag message */
946
+ trailer?: string | string[];
947
+ /** How to clean up the tag message */
948
+ cleanup?: string;
949
+ /** Key to use for GPG signing */
950
+ localUser?: string;
951
+ /** Create the tag's reflog */
952
+ createReflog?: boolean;
953
+ };
954
+ /**
955
+ * Options for git cherry-pick
956
+ */
957
+ type CherryPickOpts = {
958
+ /** Edit commit message */
959
+ edit?: boolean;
960
+ /** No commit after cherry-pick */
961
+ noCommit?: boolean;
962
+ /** Add signoff */
963
+ signoff?: boolean;
964
+ /** Mainline parent number for merge commits */
965
+ mainline?: number;
966
+ /** Strategy to use */
967
+ strategy?: string;
968
+ /** Abort cherry-pick */
969
+ abort?: boolean;
970
+ /** Continue cherry-pick */
971
+ continue?: boolean;
972
+ /** Skip current commit */
973
+ skip?: boolean;
974
+ /** Bypass pre-commit hook */
975
+ noVerify?: boolean;
976
+ /** How to clean up the commit message */
977
+ cleanup?: 'strip' | 'whitespace' | 'verbatim' | 'scissors' | 'default';
978
+ /** Automatically update rerere state */
979
+ rerereAutoupdate?: boolean;
980
+ /** Strategy options */
981
+ strategyOption?: string | string[];
982
+ /** GPG-sign the commit (optionally with key id) */
983
+ gpgSign?: boolean | string;
984
+ /** Append (cherry picked from ...) line to original message */
985
+ appendCommitName?: boolean;
986
+ /** Fast-forward if possible */
987
+ ff?: boolean;
988
+ /** Allow recording empty commits */
989
+ allowEmpty?: boolean;
990
+ /** Allow empty commit messages */
991
+ allowEmptyMessage?: boolean;
992
+ /** How to handle originally empty commits */
993
+ empty?: 'drop' | 'keep' | 'stop';
994
+ };
995
+ /**
996
+ * Options for git clean
997
+ */
998
+ type CleanOpts = {
999
+ /** Force clean */
1000
+ force?: boolean;
1001
+ /** Remove directories too */
1002
+ directories?: boolean;
1003
+ /** Remove ignored files too */
1004
+ ignored?: boolean;
1005
+ /** Only remove ignored files */
1006
+ onlyIgnored?: boolean;
1007
+ /** Dry run */
1008
+ dryRun?: boolean;
1009
+ /** Paths to clean */
1010
+ paths?: string[];
1011
+ /** Suppress output */
1012
+ quiet?: boolean;
1013
+ /** Exclude files matching pattern */
1014
+ exclude?: string | string[];
1015
+ };
1016
+ /**
1017
+ * Options for git mv
1018
+ */
1019
+ type MvOpts = {
1020
+ /** Force move */
1021
+ force?: boolean;
1022
+ /** Dry run */
1023
+ dryRun?: boolean;
1024
+ /** Be verbose */
1025
+ verbose?: boolean;
1026
+ /** Skip errors */
1027
+ skipErrors?: boolean;
1028
+ /** Allow moving files outside of sparse-checkout cone */
1029
+ sparse?: boolean;
1030
+ };
1031
+ /**
1032
+ * Options for git rebase
1033
+ */
1034
+ type RebaseOpts = {
1035
+ /** Upstream branch */
1036
+ upstream?: string;
1037
+ /** Onto target */
1038
+ onto?: string;
1039
+ /** Interactive rebase (not supported - use raw) */
1040
+ interactive?: never;
1041
+ /** Preserve merges */
1042
+ rebaseMerges?: boolean;
1043
+ /** Abort rebase */
1044
+ abort?: boolean;
1045
+ /** Continue rebase */
1046
+ continue?: boolean;
1047
+ /** Skip current commit */
1048
+ skip?: boolean;
1049
+ /** Bypass pre-rebase hook */
1050
+ noVerify?: boolean;
1051
+ /** Keep the commits at the base unchanged */
1052
+ keepBase?: boolean;
1053
+ /** Be quiet */
1054
+ quiet?: boolean;
1055
+ /** Be verbose */
1056
+ verbose?: boolean;
1057
+ /** Add signoff */
1058
+ signoff?: boolean;
1059
+ /** Set committer date to author date */
1060
+ committerDateIsAuthorDate?: boolean;
1061
+ /** Set author date to committer date */
1062
+ resetAuthorDate?: boolean;
1063
+ /** Ignore whitespace differences */
1064
+ ignoreWhitespace?: boolean;
1065
+ /** Whitespace handling mode */
1066
+ whitespace?: string;
1067
+ /** Force rebase even if already up-to-date */
1068
+ forceRebase?: boolean;
1069
+ /** Create merge commit instead of rebasing */
1070
+ noFf?: boolean;
1071
+ /** Use apply strategy */
1072
+ apply?: boolean;
1073
+ /** Automatically update rerere state */
1074
+ rerereAutoupdate?: boolean;
1075
+ /** How to handle empty commits */
1076
+ empty?: 'drop' | 'keep' | 'ask';
1077
+ /** Automatically squash fixup commits */
1078
+ autosquash?: boolean;
1079
+ /** Update refs that point to rebased commits */
1080
+ updateRefs?: boolean;
1081
+ /** GPG-sign commits */
1082
+ gpgSign?: boolean | string;
1083
+ /** Automatically stash/unstash */
1084
+ autostash?: boolean;
1085
+ /** Execute command after each commit */
1086
+ exec?: string;
1087
+ /** Use fork point for base */
1088
+ forkPoint?: boolean;
1089
+ /** Merge strategy */
1090
+ strategy?: string;
1091
+ /** Strategy options */
1092
+ strategyOption?: string | string[];
1093
+ /** Rebase from root commit */
1094
+ root?: boolean;
1095
+ /** Reschedule failed exec commands */
1096
+ rescheduleFailedExec?: boolean;
1097
+ /** Reapply cherry-picks */
1098
+ reapplyCherryPicks?: boolean;
1099
+ };
1100
+ /**
1101
+ * Options for git restore
1102
+ */
1103
+ type RestoreOpts = {
1104
+ /** Restore staged files */
1105
+ staged?: boolean;
1106
+ /** Restore working tree files */
1107
+ worktree?: boolean;
1108
+ /** Source to restore from */
1109
+ source?: string;
1110
+ /** Ours or theirs for conflicts */
1111
+ ours?: boolean;
1112
+ theirs?: boolean;
1113
+ /** Ignore unmerged entries */
1114
+ ignoreUnmerged?: boolean;
1115
+ /** Allow overlay mode (default is no-overlay) */
1116
+ overlay?: boolean;
1117
+ /** Suppress output */
1118
+ quiet?: boolean;
1119
+ /** Recurse into submodules */
1120
+ recurseSubmodules?: boolean;
1121
+ /** Show progress */
1122
+ progress?: boolean;
1123
+ /** Attempt to recreate merge conflicts */
1124
+ merge?: boolean;
1125
+ /** Conflict style for merge conflicts */
1126
+ conflict?: 'merge' | 'diff3' | 'zdiff3';
1127
+ /** Ignore skip-worktree bits */
1128
+ ignoreSkipWorktreeBits?: boolean;
1129
+ /** Read pathspecs from file */
1130
+ pathspecFromFile?: string;
1131
+ };
1132
+ /**
1133
+ * Options for git revert
1134
+ */
1135
+ type RevertOpts = {
1136
+ /** Edit commit message */
1137
+ edit?: boolean;
1138
+ /** No commit after revert */
1139
+ noCommit?: boolean;
1140
+ /** Mainline parent number for merge commits */
1141
+ mainline?: number;
1142
+ /** Abort revert */
1143
+ abort?: boolean;
1144
+ /** Continue revert */
1145
+ continue?: boolean;
1146
+ /** Skip current commit */
1147
+ skip?: boolean;
1148
+ /** Bypass pre-commit hook */
1149
+ noVerify?: boolean;
1150
+ /** How to clean up the commit message */
1151
+ cleanup?: 'strip' | 'whitespace' | 'verbatim' | 'scissors' | 'default';
1152
+ /** Add signoff */
1153
+ signoff?: boolean;
1154
+ /** Automatically update rerere state */
1155
+ rerereAutoupdate?: boolean;
1156
+ /** Merge strategy */
1157
+ strategy?: string;
1158
+ /** Strategy options */
1159
+ strategyOption?: string | string[];
1160
+ /** GPG-sign the commit */
1161
+ gpgSign?: boolean | string;
1162
+ /** Add reference to reverted commit */
1163
+ reference?: boolean;
1164
+ };
1165
+ /**
1166
+ * Options for git show
1167
+ */
1168
+ type ShowOpts = {
1169
+ /** Show stat only */
1170
+ stat?: boolean;
1171
+ /** Show name only */
1172
+ nameOnly?: boolean;
1173
+ /** Show name and status */
1174
+ nameStatus?: boolean;
1175
+ /** Format string */
1176
+ format?: string;
1177
+ /** Suppress output */
1178
+ quiet?: boolean;
1179
+ /** Show source ref for each commit */
1180
+ source?: boolean;
1181
+ /** Use mailmap for author/committer names */
1182
+ useMailmap?: boolean;
1183
+ /** Only decorate refs matching pattern */
1184
+ decorateRefs?: string;
1185
+ /** Exclude refs matching pattern from decoration */
1186
+ decorateRefsExclude?: string;
1187
+ /** Decorate style */
1188
+ decorate?: 'short' | 'full' | 'auto' | 'no';
1189
+ };
1190
+ /**
1191
+ * Options for git submodule
1192
+ */
1193
+ type SubmoduleOpts = {
1194
+ /** Recursive operation */
1195
+ recursive?: boolean;
1196
+ /** Initialize submodules */
1197
+ init?: boolean;
1198
+ /** Remote tracking branch */
1199
+ remote?: boolean;
1200
+ /** Force update */
1201
+ force?: boolean;
1202
+ /** Do not fetch from remotes */
1203
+ noFetch?: boolean;
1204
+ /** Checkout the superproject's recorded commit */
1205
+ checkout?: boolean;
1206
+ /** Merge the commit into the current branch */
1207
+ merge?: boolean;
1208
+ /** Rebase the current branch onto the commit */
1209
+ rebase?: boolean;
1210
+ /** Use recommended shallow clone depth */
1211
+ recommendShallow?: boolean;
1212
+ /** Reference repository for shared clone */
1213
+ reference?: string;
1214
+ /** Clone only one branch */
1215
+ singleBranch?: boolean;
1216
+ /** Partial clone filter specification */
1217
+ filter?: string;
1218
+ };
1219
+ /**
1220
+ * Options for adding a submodule
1221
+ */
1222
+ type SubmoduleAddOpts = {
1223
+ /** Branch to track */
1224
+ branch?: string;
1225
+ /** Force addition */
1226
+ force?: boolean;
1227
+ /** Submodule name (if different from path) */
1228
+ name?: string;
1229
+ /** Reference repository */
1230
+ reference?: string;
1231
+ /** Depth for shallow clone */
1232
+ depth?: number;
1233
+ };
1234
+ /**
1235
+ * Options for deinitializing a submodule
1236
+ */
1237
+ type SubmoduleDeinitOpts = {
1238
+ /** Force deinitialization */
1239
+ force?: boolean;
1240
+ /** Deinitialize all submodules */
1241
+ all?: boolean;
1242
+ };
1243
+ /**
1244
+ * Options for submodule status
1245
+ */
1246
+ type SubmoduleStatusOpts = {
1247
+ /** Check submodules recursively */
1248
+ recursive?: boolean;
1249
+ };
1250
+ /**
1251
+ * Options for submodule summary
1252
+ */
1253
+ type SubmoduleSummaryOpts = {
1254
+ /** Limit to the specified number of commits */
1255
+ limit?: number;
1256
+ /** Show files in the summary */
1257
+ files?: boolean;
1258
+ };
1259
+ /**
1260
+ * Options for submodule foreach
1261
+ */
1262
+ type SubmoduleForeachOpts = {
1263
+ /** Run the command recursively in nested submodules */
1264
+ recursive?: boolean;
1265
+ };
1266
+ /**
1267
+ * Options for submodule sync
1268
+ */
1269
+ type SubmoduleSyncOpts = {
1270
+ /** Sync recursively in nested submodules */
1271
+ recursive?: boolean;
1272
+ };
1273
+ /**
1274
+ * Options for submodule set-branch
1275
+ */
1276
+ type SubmoduleSetBranchOpts = {
1277
+ /** Set the default tracking branch */
1278
+ default?: boolean;
1279
+ };
1280
+ /**
1281
+ * Submodule information
1282
+ */
1283
+ type SubmoduleInfo = {
1284
+ name: string;
1285
+ path: string;
1286
+ url: string;
1287
+ branch?: string;
1288
+ commit: string;
1289
+ };
1290
+ /**
1291
+ * LFS status information
1292
+ */
1293
+ type LfsStatus = {
1294
+ files: Array<{
1295
+ name: string;
1296
+ size: number;
1297
+ status: 'checkout' | 'download' | 'upload' | 'unknown';
1298
+ }>;
1299
+ };
1300
+ /**
1301
+ * Options for LFS pull
1302
+ */
1303
+ type LfsPullOpts = {
1304
+ remote?: string;
1305
+ ref?: string;
1306
+ include?: string[];
1307
+ exclude?: string[];
1308
+ };
1309
+ /**
1310
+ * Options for LFS push
1311
+ */
1312
+ type LfsPushOpts = {
1313
+ remote?: string;
1314
+ ref?: string;
1315
+ /** Dry run - show what would be pushed without actually pushing */
1316
+ dryRun?: boolean;
1317
+ /** Push specified object IDs (OID hashes) instead of all objects */
1318
+ objectId?: string | string[];
1319
+ };
1320
+ /**
1321
+ * Options for LFS status
1322
+ */
1323
+ type LfsStatusOpts = {
1324
+ json?: boolean;
1325
+ /** Machine-readable output */
1326
+ porcelain?: boolean;
1327
+ };
1328
+ /**
1329
+ * Options for LFS prune
1330
+ */
1331
+ type LfsPruneOpts = {
1332
+ /** Force prune (remove unreferenced objects immediately) */
1333
+ force?: boolean;
1334
+ /** Dry run - show what would be pruned without actually pruning */
1335
+ dryRun?: boolean;
1336
+ /** Verify remote copies before pruning */
1337
+ verifyRemote?: boolean;
1338
+ /** Verify unreferenced copies */
1339
+ verifyUnreferenced?: boolean;
1340
+ /** Only prune objects not accessed recently */
1341
+ recent?: boolean;
1342
+ /** Show verbose output */
1343
+ verbose?: boolean;
1344
+ /** When unverified behavior: panic or ignore */
1345
+ whenUnverified?: 'panic' | 'ignore';
1346
+ };
1347
+ /**
1348
+ * Options for LFS fetch
1349
+ */
1350
+ type LfsFetchOpts = {
1351
+ /** Fetch all LFS objects for all refs */
1352
+ all?: boolean;
1353
+ /** Include patterns */
1354
+ include?: string | string[];
1355
+ /** Exclude patterns */
1356
+ exclude?: string | string[];
1357
+ /** Only fetch recent objects */
1358
+ recent?: boolean;
1359
+ /** Prune old objects after fetch */
1360
+ prune?: boolean;
1361
+ /** Refetch objects even if already local */
1362
+ refetch?: boolean;
1363
+ /** Dry run - show what would be fetched */
1364
+ dryRun?: boolean;
1365
+ /** Output in JSON format */
1366
+ json?: boolean;
1367
+ /** Remote to fetch from */
1368
+ remote?: string;
1369
+ /** Refs to fetch */
1370
+ refs?: string | string[];
1371
+ };
1372
+ /**
1373
+ * Options for repository-level LFS install
1374
+ *
1375
+ * Used with `repo.lfs.install()` for repository-local LFS configuration.
1376
+ *
1377
+ * @remarks
1378
+ * Internally runs `git lfs install --local` by default, which writes to
1379
+ * the repository's .git/config file. This ensures LFS configuration is
1380
+ * scoped to the current repository only.
1381
+ *
1382
+ * For global (user-level) or system-wide installation, use `git.lfs.install()` instead.
1383
+ */
1384
+ type RepoLfsInstallOpts = {
1385
+ /** Overwrite existing hooks */
1386
+ force?: boolean;
1387
+ /**
1388
+ * Install for worktree only (instead of repository)
1389
+ *
1390
+ * @remarks
1391
+ * Internally uses `--worktree` flag instead of `--local`.
1392
+ * Requires Git 2.20.0+ with worktreeConfig extension enabled.
1393
+ */
1394
+ worktree?: boolean;
1395
+ /** Skip smudge filter (don't download during checkout) */
1396
+ skipSmudge?: boolean;
1397
+ };
1398
+ /**
1399
+ * Options for repository-level LFS uninstall
1400
+ *
1401
+ * Used with `repo.lfs.uninstall()` for repository-local LFS configuration removal.
1402
+ *
1403
+ * @remarks
1404
+ * Internally runs `git lfs uninstall --local` by default, which modifies
1405
+ * the repository's .git/config file only.
1406
+ *
1407
+ * For global or system-wide uninstallation, use `git.lfs.uninstall()` instead.
1408
+ */
1409
+ type RepoLfsUninstallOpts = {
1410
+ /**
1411
+ * Uninstall for worktree only (instead of repository)
1412
+ *
1413
+ * @remarks
1414
+ * Internally uses `--worktree` flag instead of `--local`.
1415
+ * Requires Git 2.20.0+ with worktreeConfig extension enabled.
1416
+ */
1417
+ worktree?: boolean;
1418
+ };
1419
+ /**
1420
+ * LFS file entry
1421
+ */
1422
+ type LfsFileEntry = {
1423
+ /** File path */
1424
+ path: string;
1425
+ /** Object ID (SHA-256) */
1426
+ oid: string;
1427
+ /** File size in bytes */
1428
+ size?: number;
1429
+ /** Checkout status */
1430
+ status: 'checked-out' | 'not-checked-out';
1431
+ };
1432
+ /**
1433
+ * Options for LFS ls-files
1434
+ */
1435
+ type LfsLsFilesOpts = {
1436
+ /** Show full OID (not abbreviated) */
1437
+ long?: boolean;
1438
+ /** Show file sizes */
1439
+ size?: boolean;
1440
+ /** Show debug information */
1441
+ debug?: boolean;
1442
+ /** Show all LFS files (not just current ref) */
1443
+ all?: boolean;
1444
+ /** Show deleted files */
1445
+ deleted?: boolean;
1446
+ /** Include patterns */
1447
+ include?: string | string[];
1448
+ /** Exclude patterns */
1449
+ exclude?: string | string[];
1450
+ /** Show filenames only */
1451
+ nameOnly?: boolean;
1452
+ /** Output in JSON format */
1453
+ json?: boolean;
1454
+ /** Ref to list files for */
1455
+ ref?: string;
1456
+ };
1457
+ /**
1458
+ * LFS track entry
1459
+ */
1460
+ type LfsTrackEntry = {
1461
+ /** Pattern being tracked */
1462
+ pattern: string;
1463
+ /** Source file (e.g., .gitattributes) */
1464
+ source: string;
1465
+ /** Whether files matching pattern are lockable */
1466
+ lockable: boolean;
1467
+ };
1468
+ /**
1469
+ * Options for LFS track
1470
+ */
1471
+ type LfsTrackOpts = {
1472
+ /** Show verbose output */
1473
+ verbose?: boolean;
1474
+ /** Dry run - show what would be tracked */
1475
+ dryRun?: boolean;
1476
+ /** Treat pattern as filename, not glob */
1477
+ filename?: boolean;
1478
+ /** Make files lockable */
1479
+ lockable?: boolean;
1480
+ /** Make files not lockable */
1481
+ notLockable?: boolean;
1482
+ /** Don't exclude from export */
1483
+ noExcluded?: boolean;
1484
+ /** Don't modify .gitattributes */
1485
+ noModifyAttrs?: boolean;
1486
+ };
1487
+ /**
1488
+ * LFS lock entry
1489
+ */
1490
+ type LfsLockEntry = {
1491
+ /** Lock ID */
1492
+ id: string;
1493
+ /** Locked file path */
1494
+ path: string;
1495
+ /** Lock owner */
1496
+ owner: {
1497
+ name: string;
1498
+ };
1499
+ /** Lock timestamp */
1500
+ lockedAt: Date;
1501
+ };
1502
+ /**
1503
+ * Options for LFS lock
1504
+ */
1505
+ type LfsLockOpts = {
1506
+ /** Remote name */
1507
+ remote?: string;
1508
+ /** Output in JSON format */
1509
+ json?: boolean;
1510
+ };
1511
+ /**
1512
+ * Options for LFS unlock
1513
+ */
1514
+ type LfsUnlockOpts = {
1515
+ /** Remote name */
1516
+ remote?: string;
1517
+ /** Force unlock (even if owned by another user) */
1518
+ force?: boolean;
1519
+ /** Unlock by ID instead of path */
1520
+ id?: string;
1521
+ /** Output in JSON format */
1522
+ json?: boolean;
1523
+ };
1524
+ /**
1525
+ * Options for LFS locks
1526
+ */
1527
+ type LfsLocksOpts = {
1528
+ /** Remote name */
1529
+ remote?: string;
1530
+ /** Filter by lock ID */
1531
+ id?: string;
1532
+ /** Filter by path */
1533
+ path?: string;
1534
+ /** Show local cache only */
1535
+ local?: boolean;
1536
+ /** Show cached locks */
1537
+ cached?: boolean;
1538
+ /** Verify locks with server */
1539
+ verify?: boolean;
1540
+ /** Limit number of results */
1541
+ limit?: number;
1542
+ /** Output in JSON format */
1543
+ json?: boolean;
1544
+ };
1545
+ /**
1546
+ * Options for LFS checkout
1547
+ */
1548
+ type LfsCheckoutOpts = {
1549
+ /** Use base version for conflicts */
1550
+ base?: boolean;
1551
+ /** Use ours version for conflicts */
1552
+ ours?: boolean;
1553
+ /** Use theirs version for conflicts */
1554
+ theirs?: boolean;
1555
+ /** Write to file instead of working tree */
1556
+ to?: string;
1557
+ /** Include patterns */
1558
+ include?: string | string[];
1559
+ /** Exclude patterns */
1560
+ exclude?: string | string[];
1561
+ };
1562
+ /**
1563
+ * Options for LFS migrate info
1564
+ */
1565
+ type LfsMigrateInfoOpts = {
1566
+ /** Only show files above this size */
1567
+ above?: string | number;
1568
+ /** Show top N files */
1569
+ top?: number;
1570
+ /** Size unit (b, kb, mb, gb) */
1571
+ unit?: 'b' | 'kb' | 'mb' | 'gb';
1572
+ /** Show pointer files */
1573
+ pointers?: 'follow' | 'no-follow' | 'ignore';
1574
+ /** Fix up tracking patterns */
1575
+ fixup?: boolean;
1576
+ /** Include patterns */
1577
+ include?: string | string[];
1578
+ /** Exclude patterns */
1579
+ exclude?: string | string[];
1580
+ /** Include refs */
1581
+ includeRef?: string | string[];
1582
+ /** Exclude refs */
1583
+ excludeRef?: string | string[];
1584
+ /** Skip fetching from remote */
1585
+ skipFetch?: boolean;
1586
+ /** Operate on all refs */
1587
+ everything?: boolean;
1588
+ /** Confirm destructive operation */
1589
+ yesReally?: boolean;
1590
+ };
1591
+ /**
1592
+ * Options for LFS migrate import
1593
+ */
1594
+ type LfsMigrateImportOpts = LfsMigrateInfoOpts & {
1595
+ /** Show verbose output */
1596
+ verbose?: boolean;
1597
+ /** Write object map file */
1598
+ objectMap?: string;
1599
+ /** Don't rewrite history */
1600
+ noRewrite?: boolean;
1601
+ /** Commit message for fixup */
1602
+ message?: string;
1603
+ /** Object IDs to import */
1604
+ object?: string | string[];
1605
+ };
1606
+ /**
1607
+ * Options for LFS migrate export
1608
+ */
1609
+ type LfsMigrateExportOpts = LfsMigrateInfoOpts & {
1610
+ /** Show verbose output */
1611
+ verbose?: boolean;
1612
+ /** Write object map file */
1613
+ objectMap?: string;
1614
+ /** Remote name */
1615
+ remote?: string;
1616
+ };
1617
+ /**
1618
+ * LFS environment info
1619
+ */
1620
+ type LfsEnvInfo = {
1621
+ /** LFS version */
1622
+ lfsVersion: string;
1623
+ /** Git version */
1624
+ gitVersion: string;
1625
+ /** Endpoint URL */
1626
+ endpoint: string;
1627
+ /** SSH endpoint */
1628
+ sshEndpoint?: string;
1629
+ /** Local working directory */
1630
+ localWorkingDir?: string;
1631
+ /** Local git directory */
1632
+ localGitDir?: string;
1633
+ /** Local git storage directory */
1634
+ localGitStorageDir?: string;
1635
+ /** Local media directory */
1636
+ localMediaDir?: string;
1637
+ /** Local reference directories */
1638
+ localReferenceDirs?: string;
1639
+ /** Temp directory */
1640
+ tempDir?: string;
1641
+ /** Concurrent transfers */
1642
+ concurrentTransfers?: number;
1643
+ /** TUS transfers enabled */
1644
+ tusTransfers?: boolean;
1645
+ /** Basic transfers only */
1646
+ basicTransfersOnly?: boolean;
1647
+ /** Skip download errors */
1648
+ skipDownloadErrors?: boolean;
1649
+ /** Fetch recent always */
1650
+ fetchRecentAlways?: boolean;
1651
+ /** Fetch recent refs days */
1652
+ fetchRecentRefsDays?: number;
1653
+ /** Fetch recent commits days */
1654
+ fetchRecentCommitsDays?: number;
1655
+ /** Fetch recent refs include remotes */
1656
+ fetchRecentRefsIncludeRemotes?: boolean;
1657
+ /** Prune offset days */
1658
+ pruneOffsetDays?: number;
1659
+ /** Prune verify remote always */
1660
+ pruneVerifyRemoteAlways?: boolean;
1661
+ /** Prune remote name */
1662
+ pruneRemoteName?: string;
1663
+ /** Access mode for downloads */
1664
+ accessDownload?: string;
1665
+ /** Access mode for uploads */
1666
+ accessUpload?: string;
1667
+ };
1668
+ /**
1669
+ * Options for LFS pre-upload (§10.3)
1670
+ *
1671
+ * Pre-upload allows pushing LFS objects before the refs push,
1672
+ * enabling 2-phase commit patterns for improved reliability.
1673
+ */
1674
+ type LfsPreUploadOpts = {
1675
+ /** Object IDs to upload (if omitted, auto-detect pending objects) */
1676
+ oids?: string[];
1677
+ /** Batch size for upload (default: 50, considers Windows 8KB limit) */
1678
+ batchSize?: number;
1679
+ /** Remote name (default: 'origin') */
1680
+ remote?: string;
1681
+ };
1682
+ /**
1683
+ * Result from LFS pre-upload
1684
+ */
1685
+ type LfsPreUploadResult = {
1686
+ /** Number of objects uploaded */
1687
+ uploadedCount: number;
1688
+ /** Total bytes uploaded */
1689
+ uploadedBytes: number;
1690
+ /** Number of objects skipped (already on remote) */
1691
+ skippedCount: number;
1692
+ };
1693
+ /**
1694
+ * Options for LFS pre-download (§10.3)
1695
+ *
1696
+ * Pre-download allows fetching LFS objects before checkout,
1697
+ * useful for controlled large file management.
1698
+ */
1699
+ type LfsPreDownloadOpts = {
1700
+ /** Object IDs to download (if omitted, auto-detect from ref) */
1701
+ oids?: string[];
1702
+ /** Git ref to get LFS objects for (branch, tag, or commit) */
1703
+ ref?: string;
1704
+ /** Batch size for download (default: 50) */
1705
+ batchSize?: number;
1706
+ /** Remote name (default: 'origin') */
1707
+ remote?: string;
1708
+ };
1709
+ /**
1710
+ * Result from LFS pre-download
1711
+ */
1712
+ type LfsPreDownloadResult = {
1713
+ /** Number of objects downloaded */
1714
+ downloadedCount: number;
1715
+ /** Total bytes downloaded */
1716
+ downloadedBytes: number;
1717
+ /** Number of objects skipped (already local) */
1718
+ skippedCount: number;
1719
+ };
1720
+ /**
1721
+ * Worktree information (§7.4)
1722
+ *
1723
+ * Parsed from `git worktree list --porcelain` output.
1724
+ */
1725
+ type Worktree = {
1726
+ /** Worktree path */
1727
+ path: string;
1728
+ /** HEAD commit hash */
1729
+ head: string;
1730
+ /** Branch name (if checked out) */
1731
+ branch?: string;
1732
+ /** Whether the worktree is locked */
1733
+ locked: boolean;
1734
+ /** Whether the worktree is prunable */
1735
+ prunable: boolean;
1736
+ };
1737
+ /**
1738
+ * Options for adding a worktree
1739
+ */
1740
+ type WorktreeAddOpts = {
1741
+ /**
1742
+ * Commit-ish to checkout (branch, tag, or commit hash)
1743
+ *
1744
+ * @example
1745
+ * ```typescript
1746
+ * // Checkout a specific commit in detached mode
1747
+ * await repo.worktree.add('/tmp/worktree', { detach: true, commitish: 'abc1234' });
1748
+ *
1749
+ * // Checkout a tag
1750
+ * await repo.worktree.add('/tmp/worktree', { detach: true, commitish: 'v1.0.0' });
1751
+ *
1752
+ * // Checkout a branch
1753
+ * await repo.worktree.add('/tmp/worktree', { commitish: 'feature-branch' });
1754
+ * ```
1755
+ */
1756
+ commitish?: string;
1757
+ /** Branch name to create (-b flag) */
1758
+ branch?: string;
1759
+ /** Create detached HEAD */
1760
+ detach?: boolean;
1761
+ /** Track remote branch */
1762
+ track?: boolean;
1763
+ /** Force creation even if branch is already checked out */
1764
+ force?: boolean;
1765
+ /** Checkout the worktree (true) or not (false) */
1766
+ checkout?: boolean;
1767
+ /** Keep the worktree locked after creation */
1768
+ lock?: boolean;
1769
+ /** Create worktree with orphan branch */
1770
+ orphan?: boolean;
1771
+ };
1772
+ /**
1773
+ * Options for removing a worktree
1774
+ */
1775
+ type WorktreeRemoveOpts = {
1776
+ /** Force removal even if dirty */
1777
+ force?: boolean;
1778
+ };
1779
+ /**
1780
+ * Options for pruning worktrees
1781
+ */
1782
+ type WorktreePruneOpts = {
1783
+ /** Show what would be pruned without actually pruning */
1784
+ dryRun?: boolean;
1785
+ /** Show more details */
1786
+ verbose?: boolean;
1787
+ /** Expire worktrees older than the given time */
1788
+ expire?: string;
1789
+ };
1790
+ /**
1791
+ * Options for worktree move
1792
+ */
1793
+ type WorktreeMoveOpts = {
1794
+ /** Force move even if destination exists */
1795
+ force?: boolean;
1796
+ };
1797
+ /**
1798
+ * Options for worktree repair
1799
+ */
1800
+ type WorktreeRepairOpts = {};
1801
+ /**
1802
+ * Options for locking a worktree
1803
+ */
1804
+ type WorktreeLockOpts = {
1805
+ /** Reason for locking */
1806
+ reason?: string;
1807
+ };
1808
+ /**
1809
+ * Worktree operations
1810
+ *
1811
+ * Wraps: `git worktree` subcommands
1812
+ */
1813
+ interface WorktreeOperations {
1814
+ /**
1815
+ * List all worktrees
1816
+ *
1817
+ * Wraps: `git worktree list --porcelain`
1818
+ */
1819
+ list(opts?: ExecOpts): Promise<Worktree[]>;
1820
+ /**
1821
+ * Add a new worktree and return a repository object for it
1822
+ *
1823
+ * Wraps: `git worktree add <path>`
1824
+ *
1825
+ * @returns A WorktreeRepo instance for the newly created worktree
1826
+ */
1827
+ add(path: string, opts?: WorktreeAddOpts & ExecOpts): Promise<WorktreeRepo>;
1828
+ /**
1829
+ * Remove a worktree
1830
+ *
1831
+ * Wraps: `git worktree remove <path>`
1832
+ */
1833
+ remove(path: string, opts?: WorktreeRemoveOpts & ExecOpts): Promise<void>;
1834
+ /**
1835
+ * Prune stale worktree references
1836
+ *
1837
+ * Wraps: `git worktree prune`
1838
+ */
1839
+ prune(opts?: WorktreePruneOpts & ExecOpts): Promise<string[]>;
1840
+ /**
1841
+ * Lock a worktree
1842
+ *
1843
+ * Wraps: `git worktree lock <path>`
1844
+ */
1845
+ lock(path: string, opts?: WorktreeLockOpts & ExecOpts): Promise<void>;
1846
+ /**
1847
+ * Unlock a worktree
1848
+ *
1849
+ * Wraps: `git worktree unlock <path>`
1850
+ */
1851
+ unlock(path: string, opts?: ExecOpts): Promise<void>;
1852
+ /**
1853
+ * Move a worktree to a new location and return a repository object for it
1854
+ *
1855
+ * Wraps: `git worktree move <src> <dst>`
1856
+ *
1857
+ * @returns A WorktreeRepo instance for the worktree at the new location
1858
+ */
1859
+ move(src: string, dst: string, opts?: WorktreeMoveOpts & ExecOpts): Promise<WorktreeRepo>;
1860
+ /**
1861
+ * Repair worktree administrative files
1862
+ *
1863
+ * Wraps: `git worktree repair`
1864
+ */
1865
+ repair(paths?: string[], opts?: ExecOpts): Promise<void>;
1866
+ }
1867
+ /**
1868
+ * LFS operations
1869
+ *
1870
+ * Wraps: `git lfs` subcommands
1871
+ */
1872
+ interface LfsOperations {
1873
+ /**
1874
+ * Pull LFS objects
1875
+ *
1876
+ * Wraps: `git lfs pull`
1877
+ */
1878
+ pull(opts?: LfsPullOpts & ExecOpts): Promise<void>;
1879
+ /**
1880
+ * Push LFS objects
1881
+ *
1882
+ * Wraps: `git lfs push`
1883
+ */
1884
+ push(opts?: LfsPushOpts & ExecOpts): Promise<void>;
1885
+ /**
1886
+ * Get LFS status
1887
+ *
1888
+ * Wraps: `git lfs status`
1889
+ */
1890
+ status(opts?: LfsStatusOpts & ExecOpts): Promise<LfsStatus>;
1891
+ /**
1892
+ * Prune old and unreferenced LFS objects from local storage
1893
+ *
1894
+ * Wraps: `git lfs prune`
1895
+ */
1896
+ prune(opts?: LfsPruneOpts & ExecOpts): Promise<void>;
1897
+ /**
1898
+ * Fetch LFS objects from remote
1899
+ *
1900
+ * Wraps: `git lfs fetch`
1901
+ */
1902
+ fetch(opts?: LfsFetchOpts & ExecOpts): Promise<void>;
1903
+ /**
1904
+ * Install Git LFS hooks for this repository
1905
+ *
1906
+ * Wraps: `git lfs install --local`
1907
+ *
1908
+ * Installs LFS hooks to the repository's .git/config file.
1909
+ * This ensures LFS configuration is scoped to this repository only.
1910
+ *
1911
+ * @remarks
1912
+ * Internally always adds `--local` flag (or `--worktree` if specified).
1913
+ * For global or system-wide installation, use `git.lfs.install()` instead.
1914
+ *
1915
+ * @example
1916
+ * ```typescript
1917
+ * // Install LFS locally for this repository
1918
+ * await repo.lfs.install();
1919
+ *
1920
+ * // Install for worktree only (Git 2.20.0+)
1921
+ * await repo.lfs.install({ worktree: true });
1922
+ * ```
1923
+ */
1924
+ install(opts?: RepoLfsInstallOpts & ExecOpts): Promise<void>;
1925
+ /**
1926
+ * Uninstall Git LFS hooks from this repository
1927
+ *
1928
+ * Wraps: `git lfs uninstall --local`
1929
+ *
1930
+ * Removes LFS hooks from the repository's .git/config file.
1931
+ *
1932
+ * @remarks
1933
+ * Internally always adds `--local` flag (or `--worktree` if specified).
1934
+ * For global or system-wide uninstallation, use `git.lfs.uninstall()` instead.
1935
+ *
1936
+ * @example
1937
+ * ```typescript
1938
+ * // Uninstall LFS from this repository
1939
+ * await repo.lfs.uninstall();
1940
+ * ```
1941
+ */
1942
+ uninstall(opts?: RepoLfsUninstallOpts & ExecOpts): Promise<void>;
1943
+ /**
1944
+ * List LFS files in the repository
1945
+ *
1946
+ * Wraps: `git lfs ls-files`
1947
+ */
1948
+ lsFiles(opts?: LfsLsFilesOpts & ExecOpts): Promise<LfsFileEntry[]>;
1949
+ /**
1950
+ * Track files with LFS
1951
+ *
1952
+ * Wraps: `git lfs track <pattern>...`
1953
+ */
1954
+ track(patterns: string | string[], opts?: LfsTrackOpts & ExecOpts): Promise<void>;
1955
+ /**
1956
+ * List tracked patterns
1957
+ *
1958
+ * Wraps: `git lfs track` (without arguments)
1959
+ */
1960
+ trackList(opts?: ExecOpts): Promise<LfsTrackEntry[]>;
1961
+ /**
1962
+ * Untrack files from LFS
1963
+ *
1964
+ * Wraps: `git lfs untrack <pattern>...`
1965
+ */
1966
+ untrack(patterns: string | string[], opts?: ExecOpts): Promise<void>;
1967
+ /**
1968
+ * Lock a file
1969
+ *
1970
+ * Wraps: `git lfs lock <path>`
1971
+ */
1972
+ lock(path: string, opts?: LfsLockOpts & ExecOpts): Promise<LfsLockEntry>;
1973
+ /**
1974
+ * Unlock a file
1975
+ *
1976
+ * Wraps: `git lfs unlock <path>`
1977
+ */
1978
+ unlock(pathOrId: string, opts?: LfsUnlockOpts & ExecOpts): Promise<void>;
1979
+ /**
1980
+ * List locked files
1981
+ *
1982
+ * Wraps: `git lfs locks`
1983
+ */
1984
+ locks(opts?: LfsLocksOpts & ExecOpts): Promise<LfsLockEntry[]>;
1985
+ /**
1986
+ * Checkout LFS files (replace pointer files with actual content)
1987
+ *
1988
+ * Wraps: `git lfs checkout`
1989
+ */
1990
+ checkout(patterns?: string | string[], opts?: LfsCheckoutOpts & ExecOpts): Promise<void>;
1991
+ /**
1992
+ * Show information about LFS files that would be migrated
1993
+ *
1994
+ * Wraps: `git lfs migrate info`
1995
+ */
1996
+ migrateInfo(opts?: LfsMigrateInfoOpts & ExecOpts): Promise<string>;
1997
+ /**
1998
+ * Import files into LFS
1999
+ *
2000
+ * Wraps: `git lfs migrate import`
2001
+ */
2002
+ migrateImport(opts?: LfsMigrateImportOpts & ExecOpts): Promise<void>;
2003
+ /**
2004
+ * Export files from LFS
2005
+ *
2006
+ * Wraps: `git lfs migrate export`
2007
+ */
2008
+ migrateExport(opts?: LfsMigrateExportOpts & ExecOpts): Promise<void>;
2009
+ /**
2010
+ * Get LFS environment information
2011
+ *
2012
+ * Wraps: `git lfs env`
2013
+ */
2014
+ env(opts?: ExecOpts): Promise<LfsEnvInfo>;
2015
+ /**
2016
+ * Get Git LFS version
2017
+ *
2018
+ * Wraps: `git lfs version`
2019
+ */
2020
+ version(opts?: ExecOpts): Promise<string>;
2021
+ }
2022
+ /**
2023
+ * LFS Extra operations interface (inspired by fs-extra)
2024
+ *
2025
+ * Additional LFS utilities not part of the core LFS commands.
2026
+ * These enable advanced patterns like 2-phase commit/fetch.
2027
+ */
2028
+ interface LfsExtraOperations {
2029
+ /**
2030
+ * Pre-upload LFS objects before refs push (§10.3)
2031
+ *
2032
+ * Enables 2-phase commit pattern for improved reliability with large files.
2033
+ * Objects are uploaded in batches to handle Windows command line limits.
2034
+ *
2035
+ * @example
2036
+ * ```typescript
2037
+ * // Phase 1: Upload LFS objects first
2038
+ * await repo.lfsExtra.preUpload({ onProgress: handleProgress });
2039
+ *
2040
+ * // Phase 2: Create commit
2041
+ * await repo.commit({ message: 'Add large files' });
2042
+ *
2043
+ * // Phase 3: Push refs (LFS already uploaded, so this is fast)
2044
+ * await repo.push();
2045
+ * ```
2046
+ */
2047
+ preUpload(opts?: LfsPreUploadOpts & ExecOpts): Promise<LfsPreUploadResult>;
2048
+ /**
2049
+ * Pre-download LFS objects before checkout (§10.3)
2050
+ *
2051
+ * Enables controlled download of large files before checkout.
2052
+ * Useful when you need to verify available space or report progress separately.
2053
+ */
2054
+ preDownload(opts?: LfsPreDownloadOpts & ExecOpts): Promise<LfsPreDownloadResult>;
2055
+ }
2056
+ /**
2057
+ * Branch operations
2058
+ *
2059
+ * Wraps: `git branch` subcommands
2060
+ */
2061
+ interface BranchOperations {
2062
+ /**
2063
+ * List branches
2064
+ *
2065
+ * Wraps: `git branch --list`
2066
+ */
2067
+ list(opts?: BranchOpts & ExecOpts): Promise<BranchInfo[]>;
2068
+ /**
2069
+ * Get current branch name
2070
+ *
2071
+ * Wraps: `git branch --show-current`
2072
+ */
2073
+ current(opts?: ExecOpts): Promise<string | null>;
2074
+ /**
2075
+ * Create a new branch
2076
+ *
2077
+ * Wraps: `git branch <name>`
2078
+ */
2079
+ create(name: string, opts?: BranchCreateOpts & ExecOpts): Promise<void>;
2080
+ /**
2081
+ * Delete a branch
2082
+ *
2083
+ * Wraps: `git branch -d|-D <name>`
2084
+ */
2085
+ delete(name: string, opts?: BranchDeleteOpts & ExecOpts): Promise<void>;
2086
+ /**
2087
+ * Rename a branch
2088
+ *
2089
+ * Wraps: `git branch -m <old> <new>`
2090
+ */
2091
+ rename(oldName: string, newName: string, opts?: ExecOpts): Promise<void>;
2092
+ }
2093
+ /**
2094
+ * Stash operations
2095
+ *
2096
+ * Wraps: `git stash` subcommands
2097
+ */
2098
+ interface StashOperations {
2099
+ /**
2100
+ * List stash entries
2101
+ *
2102
+ * Wraps: `git stash list`
2103
+ */
2104
+ list(opts?: ExecOpts): Promise<StashEntry[]>;
2105
+ /**
2106
+ * Push changes to stash
2107
+ *
2108
+ * Wraps: `git stash push`
2109
+ */
2110
+ push(opts?: StashPushOpts & ExecOpts): Promise<void>;
2111
+ /**
2112
+ * Pop stash entry
2113
+ *
2114
+ * Wraps: `git stash pop`
2115
+ */
2116
+ pop(opts?: StashApplyOpts & ExecOpts): Promise<void>;
2117
+ /**
2118
+ * Apply stash entry (without removing from stash)
2119
+ *
2120
+ * Wraps: `git stash apply`
2121
+ */
2122
+ apply(opts?: StashApplyOpts & ExecOpts): Promise<void>;
2123
+ /**
2124
+ * Drop a stash entry
2125
+ *
2126
+ * Wraps: `git stash drop`
2127
+ */
2128
+ drop(index?: number, opts?: ExecOpts): Promise<void>;
2129
+ /**
2130
+ * Clear all stash entries
2131
+ *
2132
+ * Wraps: `git stash clear`
2133
+ */
2134
+ clear(opts?: ExecOpts): Promise<void>;
2135
+ }
2136
+ /**
2137
+ * Tag operations
2138
+ *
2139
+ * Wraps: `git tag` subcommands
2140
+ */
2141
+ interface TagOperations {
2142
+ /**
2143
+ * List tags
2144
+ *
2145
+ * Wraps: `git tag --list`
2146
+ */
2147
+ list(opts?: TagListOpts & ExecOpts): Promise<string[]>;
2148
+ /**
2149
+ * Create a tag
2150
+ *
2151
+ * Wraps: `git tag <name>`
2152
+ */
2153
+ create(name: string, opts?: TagCreateOpts & ExecOpts): Promise<void>;
2154
+ /**
2155
+ * Delete a tag
2156
+ *
2157
+ * Wraps: `git tag -d <name>`
2158
+ */
2159
+ delete(name: string, opts?: ExecOpts): Promise<void>;
2160
+ /**
2161
+ * Get tag info
2162
+ *
2163
+ * Wraps: `git tag -v <name>` / `git show <tag>`
2164
+ */
2165
+ show(name: string, opts?: ExecOpts): Promise<TagInfo>;
2166
+ }
2167
+ /**
2168
+ * Remote information
2169
+ */
2170
+ type RemoteInfo = {
2171
+ /** Remote name */
2172
+ name: string;
2173
+ /** Fetch URL */
2174
+ fetchUrl: string;
2175
+ /** Push URL (may differ from fetchUrl) */
2176
+ pushUrl: string;
2177
+ };
2178
+ /**
2179
+ * Options for adding a remote
2180
+ */
2181
+ type RemoteAddOpts = {
2182
+ /** Set up tracking for default branch */
2183
+ track?: string;
2184
+ /** Only fetch specified branches */
2185
+ fetch?: boolean;
2186
+ /** Set up as mirror */
2187
+ mirror?: 'fetch' | 'push';
2188
+ /** Import tags from remote (true) or not (false) */
2189
+ tags?: boolean;
2190
+ };
2191
+ /**
2192
+ * Options for remote set-head
2193
+ */
2194
+ type RemoteSetHeadOpts = {
2195
+ /** Automatically determine remote HEAD */
2196
+ auto?: boolean;
2197
+ /** Delete the symbolic-ref for remote HEAD */
2198
+ delete?: boolean;
2199
+ };
2200
+ /**
2201
+ * Options for remote show
2202
+ */
2203
+ type RemoteShowOpts = {
2204
+ /** Do not query remote heads */
2205
+ noQuery?: boolean;
2206
+ };
2207
+ /**
2208
+ * Options for remote prune
2209
+ */
2210
+ type RemotePruneOpts = {
2211
+ /** Dry run - show what would be pruned */
2212
+ dryRun?: boolean;
2213
+ };
2214
+ /**
2215
+ * Options for remote update
2216
+ */
2217
+ type RemoteUpdateOpts = {
2218
+ /** Prune remote-tracking branches */
2219
+ prune?: boolean;
2220
+ };
2221
+ /**
2222
+ * Options for remote set-branches
2223
+ */
2224
+ type RemoteSetBranchesOpts = {
2225
+ /** Add branches instead of replacing */
2226
+ add?: boolean;
2227
+ };
2228
+ /**
2229
+ * Options for getting/setting remote URL
2230
+ */
2231
+ type RemoteUrlOpts = {
2232
+ /** Target push URL instead of fetch URL */
2233
+ push?: boolean;
2234
+ };
2235
+ /**
2236
+ * Remote operations
2237
+ *
2238
+ * Wraps: `git remote` subcommands
2239
+ */
2240
+ interface RemoteOperations {
2241
+ /**
2242
+ * List remotes
2243
+ *
2244
+ * Wraps: `git remote -v`
2245
+ */
2246
+ list(opts?: ExecOpts): Promise<RemoteInfo[]>;
2247
+ /**
2248
+ * Add a remote
2249
+ *
2250
+ * Wraps: `git remote add <name> <url>`
2251
+ */
2252
+ add(name: string, url: string, opts?: RemoteAddOpts & ExecOpts): Promise<void>;
2253
+ /**
2254
+ * Remove a remote
2255
+ *
2256
+ * Wraps: `git remote remove <name>`
2257
+ */
2258
+ remove(name: string, opts?: ExecOpts): Promise<void>;
2259
+ /**
2260
+ * Rename a remote
2261
+ *
2262
+ * Wraps: `git remote rename <old> <new>`
2263
+ */
2264
+ rename(oldName: string, newName: string, opts?: ExecOpts): Promise<void>;
2265
+ /**
2266
+ * Get remote URL
2267
+ *
2268
+ * Wraps: `git remote get-url <name>`
2269
+ */
2270
+ getUrl(name: string, opts?: RemoteUrlOpts & ExecOpts): Promise<string>;
2271
+ /**
2272
+ * Set remote URL
2273
+ *
2274
+ * Wraps: `git remote set-url <name> <url>`
2275
+ */
2276
+ setUrl(name: string, url: string, opts?: RemoteUrlOpts & ExecOpts): Promise<void>;
2277
+ /**
2278
+ * Set remote HEAD
2279
+ *
2280
+ * Wraps: `git remote set-head <remote> <branch>`
2281
+ */
2282
+ setHead(remote: string, branch?: string, opts?: RemoteSetHeadOpts & ExecOpts): Promise<void>;
2283
+ /**
2284
+ * Show information about a remote
2285
+ *
2286
+ * Wraps: `git remote show <remote>`
2287
+ */
2288
+ show(remote: string, opts?: RemoteShowOpts & ExecOpts): Promise<string>;
2289
+ /**
2290
+ * Prune stale remote-tracking branches
2291
+ *
2292
+ * Wraps: `git remote prune <remote>`
2293
+ */
2294
+ prune(remote: string, opts?: RemotePruneOpts & ExecOpts): Promise<string[]>;
2295
+ /**
2296
+ * Update remotes
2297
+ *
2298
+ * Wraps: `git remote update`
2299
+ */
2300
+ update(remotes?: string[], opts?: RemoteUpdateOpts & ExecOpts): Promise<void>;
2301
+ /**
2302
+ * Set tracked branches for a remote
2303
+ *
2304
+ * Wraps: `git remote set-branches <remote> <branch>...`
2305
+ */
2306
+ setBranches(remote: string, branches: string[], opts?: RemoteSetBranchesOpts & ExecOpts): Promise<void>;
2307
+ }
2308
+ /**
2309
+ * Config entry
2310
+ */
2311
+ type ConfigEntry = {
2312
+ /** Config key (e.g., 'user.name') */
2313
+ key: string;
2314
+ /** Config value */
2315
+ value: string;
2316
+ };
2317
+ /**
2318
+ * Options for config get
2319
+ */
2320
+ type ConfigGetOpts = {
2321
+ /** Get all values for multi-valued key */
2322
+ all?: boolean;
2323
+ /** Type to interpret the value as */
2324
+ type?: 'bool' | 'int' | 'bool-or-int' | 'path' | 'expiry-date' | 'color';
2325
+ /** Default value to use if the key is not set */
2326
+ default?: string;
2327
+ };
2328
+ /**
2329
+ * Options for config set
2330
+ */
2331
+ type ConfigSetOpts = {
2332
+ /** Add value to multi-valued key instead of replacing */
2333
+ add?: boolean;
2334
+ };
2335
+ /**
2336
+ * Options for config list
2337
+ */
2338
+ type ConfigListOpts = {
2339
+ /** Show origin of each value */
2340
+ showOrigin?: boolean;
2341
+ /** Show scope of each value */
2342
+ showScope?: boolean;
2343
+ /** Respect include directives */
2344
+ includes?: boolean;
2345
+ /** Only show config key names */
2346
+ nameOnly?: boolean;
2347
+ };
2348
+ /**
2349
+ * Well-known git config keys with their expected value types
2350
+ *
2351
+ * This provides type safety for common config operations.
2352
+ * For arbitrary keys, use getRaw/setRaw.
2353
+ */
2354
+ type ConfigSchema = {
2355
+ 'user.name': string;
2356
+ 'user.email': string;
2357
+ 'user.signingkey': string;
2358
+ 'core.autocrlf': 'true' | 'false' | 'input';
2359
+ 'core.filemode': 'true' | 'false';
2360
+ 'core.ignorecase': 'true' | 'false';
2361
+ 'core.bare': 'true' | 'false';
2362
+ 'core.logallrefupdates': 'true' | 'false' | 'always';
2363
+ 'core.repositoryformatversion': string;
2364
+ 'core.quotepath': 'true' | 'false';
2365
+ 'core.editor': string;
2366
+ 'core.pager': string;
2367
+ 'core.excludesfile': string;
2368
+ 'core.attributesfile': string;
2369
+ 'core.hooksPath': string;
2370
+ 'core.sshCommand': string;
2371
+ 'init.defaultBranch': string;
2372
+ 'commit.gpgsign': 'true' | 'false';
2373
+ 'commit.template': string;
2374
+ 'tag.gpgsign': 'true' | 'false';
2375
+ 'tag.forcesignannotated': 'true' | 'false';
2376
+ 'push.default': 'nothing' | 'current' | 'upstream' | 'tracking' | 'simple' | 'matching';
2377
+ 'push.followTags': 'true' | 'false';
2378
+ 'push.autoSetupRemote': 'true' | 'false';
2379
+ 'push.gpgSign': 'true' | 'false' | 'if-asked';
2380
+ 'pull.rebase': 'true' | 'false' | 'merges' | 'interactive';
2381
+ 'pull.ff': 'true' | 'false' | 'only';
2382
+ 'fetch.prune': 'true' | 'false';
2383
+ 'fetch.pruneTags': 'true' | 'false';
2384
+ 'merge.ff': 'true' | 'false' | 'only';
2385
+ 'merge.conflictstyle': 'merge' | 'diff3' | 'zdiff3';
2386
+ 'rebase.autoStash': 'true' | 'false';
2387
+ 'rebase.autoSquash': 'true' | 'false';
2388
+ 'rebase.updateRefs': 'true' | 'false';
2389
+ 'diff.algorithm': 'default' | 'minimal' | 'patience' | 'histogram';
2390
+ 'diff.colorMoved': 'no' | 'default' | 'plain' | 'blocks' | 'zebra' | 'dimmed-zebra';
2391
+ 'color.ui': 'auto' | 'always' | 'never' | 'true' | 'false';
2392
+ 'credential.helper': string;
2393
+ 'gpg.format': 'openpgp' | 'x509' | 'ssh';
2394
+ 'gpg.program': string;
2395
+ 'gpg.ssh.program': string;
2396
+ 'gpg.ssh.allowedSignersFile': string;
2397
+ 'http.proxy': string;
2398
+ 'http.sslVerify': 'true' | 'false';
2399
+ 'lfs.fetchexclude': string;
2400
+ 'lfs.fetchinclude': string;
2401
+ 'safe.directory': string;
2402
+ };
2403
+ /**
2404
+ * Known config key names
2405
+ */
2406
+ type ConfigKey = keyof ConfigSchema;
2407
+ /**
2408
+ * Config operations (repository-level)
2409
+ *
2410
+ * Wraps: `git config` subcommands
2411
+ */
2412
+ interface ConfigOperations {
2413
+ /**
2414
+ * Get a typed config value
2415
+ *
2416
+ * Wraps: `git config --get <key>`
2417
+ *
2418
+ * @returns Config value or undefined if not set
2419
+ */
2420
+ get<K extends ConfigKey>(key: K, opts?: ExecOpts): Promise<ConfigSchema[K] | undefined>;
2421
+ /**
2422
+ * Get all values for a multi-valued config key
2423
+ *
2424
+ * Wraps: `git config --get-all <key>`
2425
+ */
2426
+ getAll<K extends ConfigKey>(key: K, opts?: ExecOpts): Promise<ConfigSchema[K][]>;
2427
+ /**
2428
+ * Set a typed config value
2429
+ *
2430
+ * Wraps: `git config <key> <value>`
2431
+ */
2432
+ set<K extends ConfigKey>(key: K, value: ConfigSchema[K], opts?: ExecOpts): Promise<void>;
2433
+ /**
2434
+ * Add a value to a multi-valued config key
2435
+ *
2436
+ * Wraps: `git config --add <key> <value>`
2437
+ */
2438
+ add<K extends ConfigKey>(key: K, value: ConfigSchema[K], opts?: ExecOpts): Promise<void>;
2439
+ /**
2440
+ * Unset a typed config value
2441
+ *
2442
+ * Wraps: `git config --unset <key>`
2443
+ */
2444
+ unset<K extends ConfigKey>(key: K, opts?: ExecOpts): Promise<void>;
2445
+ /**
2446
+ * Get a raw config value (for arbitrary keys)
2447
+ *
2448
+ * Wraps: `git config --get <key>`
2449
+ *
2450
+ * @returns Config value or undefined if not set
2451
+ */
2452
+ getRaw(key: string, opts?: ConfigGetOpts & ExecOpts): Promise<string | string[] | undefined>;
2453
+ /**
2454
+ * Set a raw config value (for arbitrary keys)
2455
+ *
2456
+ * Wraps: `git config <key> <value>`
2457
+ */
2458
+ setRaw(key: string, value: string, opts?: ConfigSetOpts & ExecOpts): Promise<void>;
2459
+ /**
2460
+ * Unset a raw config value (for arbitrary keys)
2461
+ *
2462
+ * Wraps: `git config --unset <key>`
2463
+ */
2464
+ unsetRaw(key: string, opts?: ExecOpts): Promise<void>;
2465
+ /**
2466
+ * List all config values
2467
+ *
2468
+ * Wraps: `git config --list`
2469
+ */
2470
+ list(opts?: ConfigListOpts & ExecOpts): Promise<ConfigEntry[]>;
2471
+ /**
2472
+ * Rename a config section
2473
+ *
2474
+ * Wraps: `git config --rename-section <old> <new>`
2475
+ */
2476
+ renameSection(oldName: string, newName: string, opts?: ExecOpts): Promise<void>;
2477
+ /**
2478
+ * Remove a config section
2479
+ *
2480
+ * Wraps: `git config --remove-section <name>`
2481
+ */
2482
+ removeSection(name: string, opts?: ExecOpts): Promise<void>;
2483
+ }
2484
+ /**
2485
+ * Submodule operations
2486
+ *
2487
+ * Wraps: `git submodule` subcommands
2488
+ */
2489
+ interface SubmoduleOperations {
2490
+ /**
2491
+ * List submodules
2492
+ *
2493
+ * Wraps: `git submodule status`
2494
+ */
2495
+ list(opts?: ExecOpts): Promise<SubmoduleInfo[]>;
2496
+ /**
2497
+ * Initialize submodules
2498
+ *
2499
+ * Wraps: `git submodule init`
2500
+ */
2501
+ init(paths?: string[], opts?: ExecOpts): Promise<void>;
2502
+ /**
2503
+ * Update submodules
2504
+ *
2505
+ * Wraps: `git submodule update`
2506
+ */
2507
+ update(opts?: SubmoduleOpts & ExecOpts): Promise<void>;
2508
+ /**
2509
+ * Add a submodule
2510
+ *
2511
+ * Wraps: `git submodule add <url> <path>`
2512
+ */
2513
+ add(url: string, path: string, opts?: SubmoduleAddOpts & ExecOpts): Promise<void>;
2514
+ /**
2515
+ * Deinitialize a submodule
2516
+ *
2517
+ * Wraps: `git submodule deinit <path>`
2518
+ */
2519
+ deinit(path: string, opts?: SubmoduleDeinitOpts & ExecOpts): Promise<void>;
2520
+ /**
2521
+ * Get submodule status
2522
+ *
2523
+ * Wraps: `git submodule status`
2524
+ */
2525
+ status(paths?: string[], opts?: SubmoduleStatusOpts & ExecOpts): Promise<string>;
2526
+ /**
2527
+ * Get submodule summary
2528
+ *
2529
+ * Wraps: `git submodule summary`
2530
+ */
2531
+ summary(opts?: SubmoduleSummaryOpts & ExecOpts): Promise<string>;
2532
+ /**
2533
+ * Run a command in each submodule
2534
+ *
2535
+ * Wraps: `git submodule foreach <command>`
2536
+ */
2537
+ foreach(command: string, opts?: SubmoduleForeachOpts & ExecOpts): Promise<string>;
2538
+ /**
2539
+ * Sync submodule URL configuration
2540
+ *
2541
+ * Wraps: `git submodule sync`
2542
+ */
2543
+ sync(paths?: string[], opts?: SubmoduleSyncOpts & ExecOpts): Promise<void>;
2544
+ /**
2545
+ * Absorb git directories of submodules into the superproject
2546
+ *
2547
+ * Wraps: `git submodule absorbgitdirs`
2548
+ */
2549
+ absorbGitDirs(opts?: ExecOpts): Promise<void>;
2550
+ /**
2551
+ * Set the branch for a submodule
2552
+ *
2553
+ * Wraps: `git submodule set-branch --branch <branch> -- <path>`
2554
+ */
2555
+ setBranch(path: string, branch: string, opts?: SubmoduleSetBranchOpts & ExecOpts): Promise<void>;
2556
+ /**
2557
+ * Set the URL for a submodule
2558
+ *
2559
+ * Wraps: `git submodule set-url -- <path> <url>`
2560
+ */
2561
+ setUrl(path: string, url: string, opts?: ExecOpts): Promise<void>;
2562
+ }
2563
+ /**
2564
+ * Repository with working directory
2565
+ *
2566
+ * Provides type-safe wrappers for Git commands that operate on repositories
2567
+ * with a working tree. Each method corresponds to a specific Git CLI command
2568
+ * or subcommand.
2569
+ */
2570
+ interface WorktreeRepo extends RepoBase {
2571
+ /** Path to the working directory */
2572
+ readonly workdir: string;
2573
+ /**
2574
+ * Get repository status
2575
+ *
2576
+ * Wraps: `git status`
2577
+ *
2578
+ * @example
2579
+ * ```typescript
2580
+ * const status = await repo.status();
2581
+ * console.log(status.entries); // Changed files
2582
+ * console.log(status.branch); // Current branch
2583
+ * ```
2584
+ */
2585
+ status(opts?: StatusOpts & ExecOpts): Promise<StatusPorcelain>;
2586
+ /**
2587
+ * Get commit log
2588
+ *
2589
+ * Wraps: `git log`
2590
+ *
2591
+ * @example
2592
+ * ```typescript
2593
+ * const commits = await repo.log({ maxCount: 10 });
2594
+ * ```
2595
+ */
2596
+ log(opts?: LogOpts & ExecOpts): Promise<Commit[]>;
2597
+ /**
2598
+ * Fetch from remote
2599
+ *
2600
+ * Wraps: `git fetch`
2601
+ *
2602
+ * @example
2603
+ * ```typescript
2604
+ * await repo.fetch({ remote: 'origin', prune: true });
2605
+ * ```
2606
+ */
2607
+ fetch(opts?: FetchOpts & ExecOpts): Promise<void>;
2608
+ /**
2609
+ * Push to remote
2610
+ *
2611
+ * Wraps: `git push`
2612
+ *
2613
+ * @example
2614
+ * ```typescript
2615
+ * await repo.push({ remote: 'origin', refspec: 'main' });
2616
+ * ```
2617
+ */
2618
+ push(opts?: PushOpts & ExecOpts): Promise<void>;
2619
+ /**
2620
+ * Git LFS operations
2621
+ *
2622
+ * Wraps: `git lfs *` commands
2623
+ */
2624
+ lfs: LfsOperations;
2625
+ /**
2626
+ * Git LFS extra operations (inspired by fs-extra)
2627
+ *
2628
+ * Additional utilities for advanced LFS patterns like 2-phase commit/fetch.
2629
+ */
2630
+ lfsExtra: LfsExtraOperations;
2631
+ /**
2632
+ * Git worktree operations
2633
+ *
2634
+ * Wraps: `git worktree *` commands
2635
+ */
2636
+ worktree: WorktreeOperations;
2637
+ /**
2638
+ * Configure LFS mode for this repository
2639
+ */
2640
+ setLfsMode(mode: LfsMode): void;
2641
+ /**
2642
+ * Add files to the index
2643
+ *
2644
+ * Wraps: `git add`
2645
+ *
2646
+ * @example
2647
+ * ```typescript
2648
+ * await repo.add(['file1.txt', 'file2.txt']);
2649
+ * await repo.add('.', { all: true });
2650
+ * ```
2651
+ */
2652
+ add(paths: string | string[], opts?: AddOpts & ExecOpts): Promise<void>;
2653
+ /**
2654
+ * Git branch operations
2655
+ *
2656
+ * Wraps: `git branch *` commands
2657
+ */
2658
+ branch: BranchOperations;
2659
+ /**
2660
+ * Checkout a branch, tag, or commit (branch switching mode)
2661
+ *
2662
+ * Wraps: `git checkout <branch>`
2663
+ *
2664
+ * @example
2665
+ * ```typescript
2666
+ * await repo.checkout('main');
2667
+ * await repo.checkout('feature', { createBranch: true });
2668
+ * await repo.checkout('feature', { createBranch: true, startPoint: 'origin/main' });
2669
+ * ```
2670
+ */
2671
+ checkout(target: string, opts?: CheckoutBranchOpts & ExecOpts): Promise<void>;
2672
+ /**
2673
+ * Checkout specific files from a tree-ish (pathspec mode)
2674
+ *
2675
+ * Wraps: `git checkout [<tree-ish>] -- <pathspec>...`
2676
+ *
2677
+ * @example
2678
+ * ```typescript
2679
+ * // Restore file from index (discard working tree changes)
2680
+ * await repo.checkout(['file.txt']);
2681
+ *
2682
+ * // Restore file from HEAD
2683
+ * await repo.checkout(['file.txt'], { source: 'HEAD' });
2684
+ *
2685
+ * // Restore file from specific commit
2686
+ * await repo.checkout(['src/'], { source: 'abc123' });
2687
+ *
2688
+ * // Resolve conflict with ours/theirs
2689
+ * await repo.checkout(['conflicted.txt'], { ours: true });
2690
+ * ```
2691
+ */
2692
+ checkout(paths: string[], opts?: CheckoutPathOpts & ExecOpts): Promise<void>;
2693
+ /**
2694
+ * Create a commit
2695
+ *
2696
+ * Wraps: `git commit`
2697
+ *
2698
+ * @example
2699
+ * ```typescript
2700
+ * const result = await repo.commit({ message: 'feat: add new feature' });
2701
+ * console.log(result.hash);
2702
+ * ```
2703
+ */
2704
+ commit(opts?: CommitOpts & ExecOpts): Promise<CommitResult>;
2705
+ /**
2706
+ * Show changes between commits, commit and working tree, etc.
2707
+ *
2708
+ * Wraps: `git diff`
2709
+ *
2710
+ * @example
2711
+ * ```typescript
2712
+ * const diff = await repo.diff('HEAD~1');
2713
+ * const staged = await repo.diff({ staged: true });
2714
+ * ```
2715
+ */
2716
+ diff(target?: string, opts?: DiffOpts & ExecOpts): Promise<DiffResult>;
2717
+ /**
2718
+ * Merge branches
2719
+ *
2720
+ * Wraps: `git merge`
2721
+ *
2722
+ * @example
2723
+ * ```typescript
2724
+ * const result = await repo.merge('feature-branch');
2725
+ * ```
2726
+ */
2727
+ merge(branch: string, opts?: MergeOpts & ExecOpts): Promise<MergeResult>;
2728
+ /**
2729
+ * Pull from remote (fetch + merge/rebase)
2730
+ *
2731
+ * Wraps: `git pull`
2732
+ *
2733
+ * @example
2734
+ * ```typescript
2735
+ * await repo.pull({ remote: 'origin', rebase: true });
2736
+ * ```
2737
+ */
2738
+ pull(opts?: PullOpts & ExecOpts): Promise<void>;
2739
+ /**
2740
+ * Reset current HEAD to the specified state
2741
+ *
2742
+ * Wraps: `git reset`
2743
+ *
2744
+ * @example
2745
+ * ```typescript
2746
+ * await repo.reset('HEAD~1', { hard: true });
2747
+ * await repo.reset({ soft: true });
2748
+ * ```
2749
+ */
2750
+ reset(target?: string, opts?: ResetOpts & ExecOpts): Promise<void>;
2751
+ /**
2752
+ * Remove files from the working tree and from the index
2753
+ *
2754
+ * Wraps: `git rm`
2755
+ *
2756
+ * @example
2757
+ * ```typescript
2758
+ * await repo.rm('file.txt');
2759
+ * await repo.rm('dir/', { recursive: true });
2760
+ * ```
2761
+ */
2762
+ rm(paths: string | string[], opts?: RmOpts & ExecOpts): Promise<void>;
2763
+ /**
2764
+ * Git stash operations
2765
+ *
2766
+ * Wraps: `git stash *` commands
2767
+ */
2768
+ stash: StashOperations;
2769
+ /**
2770
+ * Switch branches
2771
+ *
2772
+ * Wraps: `git switch`
2773
+ *
2774
+ * @example
2775
+ * ```typescript
2776
+ * await repo.switch('main');
2777
+ * await repo.switch('new-branch', { create: true });
2778
+ * ```
2779
+ */
2780
+ switch(branch: string, opts?: SwitchOpts & ExecOpts): Promise<void>;
2781
+ /**
2782
+ * Git tag operations
2783
+ *
2784
+ * Wraps: `git tag *` commands
2785
+ */
2786
+ tag: TagOperations;
2787
+ /**
2788
+ * Apply changes from existing commits
2789
+ *
2790
+ * Wraps: `git cherry-pick`
2791
+ *
2792
+ * @example
2793
+ * ```typescript
2794
+ * await repo.cherryPick('abc123');
2795
+ * await repo.cherryPick(['abc123', 'def456']);
2796
+ * ```
2797
+ */
2798
+ cherryPick(commits: string | string[], opts?: CherryPickOpts & ExecOpts): Promise<void>;
2799
+ /**
2800
+ * Remove untracked files from the working tree
2801
+ *
2802
+ * Wraps: `git clean`
2803
+ *
2804
+ * @example
2805
+ * ```typescript
2806
+ * const removed = await repo.clean({ force: true, directories: true });
2807
+ * ```
2808
+ */
2809
+ clean(opts?: CleanOpts & ExecOpts): Promise<string[]>;
2810
+ /**
2811
+ * Move or rename files
2812
+ *
2813
+ * Wraps: `git mv`
2814
+ *
2815
+ * @example
2816
+ * ```typescript
2817
+ * await repo.mv('old-name.txt', 'new-name.txt');
2818
+ * ```
2819
+ */
2820
+ mv(source: string, destination: string, opts?: MvOpts & ExecOpts): Promise<void>;
2821
+ /**
2822
+ * Reapply commits on top of another base
2823
+ *
2824
+ * Wraps: `git rebase`
2825
+ *
2826
+ * @example
2827
+ * ```typescript
2828
+ * await repo.rebase({ onto: 'main' });
2829
+ * await repo.rebase({ abort: true });
2830
+ * ```
2831
+ */
2832
+ rebase(opts?: RebaseOpts & ExecOpts): Promise<void>;
2833
+ /**
2834
+ * Restore working tree files
2835
+ *
2836
+ * Wraps: `git restore`
2837
+ *
2838
+ * @example
2839
+ * ```typescript
2840
+ * await repo.restore(['file.txt'], { staged: true });
2841
+ * await repo.restore(['.'], { source: 'HEAD' });
2842
+ * ```
2843
+ */
2844
+ restore(paths: string | string[], opts?: RestoreOpts & ExecOpts): Promise<void>;
2845
+ /**
2846
+ * Revert existing commits
2847
+ *
2848
+ * Wraps: `git revert`
2849
+ *
2850
+ * @example
2851
+ * ```typescript
2852
+ * await repo.revert('abc123');
2853
+ * await repo.revert(['abc123', 'def456'], { noCommit: true });
2854
+ * ```
2855
+ */
2856
+ revert(commits: string | string[], opts?: RevertOpts & ExecOpts): Promise<void>;
2857
+ /**
2858
+ * Show various types of objects
2859
+ *
2860
+ * Wraps: `git show`
2861
+ *
2862
+ * @example
2863
+ * ```typescript
2864
+ * const content = await repo.show('HEAD:README.md');
2865
+ * const commitInfo = await repo.show('abc123');
2866
+ * ```
2867
+ */
2868
+ show(object: string, opts?: ShowOpts & ExecOpts): Promise<string>;
2869
+ /**
2870
+ * Parse revision specification and return the object name (SHA)
2871
+ *
2872
+ * Wraps: `git rev-parse`
2873
+ *
2874
+ * Useful for resolving refs like HEAD, branch names, or relative refs like HEAD~1
2875
+ *
2876
+ * @example
2877
+ * ```typescript
2878
+ * const sha = await repo.revParse('HEAD');
2879
+ * const parentSha = await repo.revParse('HEAD~1');
2880
+ * const branchSha = await repo.revParse('main');
2881
+ * ```
2882
+ */
2883
+ revParse(ref: string, opts?: ExecOpts): Promise<string>;
2884
+ /**
2885
+ * Count the number of commits reachable from a ref
2886
+ *
2887
+ * Wraps: `git rev-list --count`
2888
+ *
2889
+ * @example
2890
+ * ```typescript
2891
+ * const count = await repo.revListCount('HEAD');
2892
+ * const featureCommits = await repo.revListCount('main..feature');
2893
+ * ```
2894
+ */
2895
+ revListCount(ref?: string, opts?: ExecOpts): Promise<number>;
2896
+ /**
2897
+ * Read or modify symbolic refs
2898
+ *
2899
+ * Wraps: `git symbolic-ref`
2900
+ *
2901
+ * Without newRef: reads the symbolic ref (e.g., get what HEAD points to)
2902
+ * With newRef: sets the symbolic ref to point to newRef
2903
+ *
2904
+ * @example
2905
+ * ```typescript
2906
+ * // Read what HEAD points to
2907
+ * const branch = await repo.symbolicRef('HEAD');
2908
+ *
2909
+ * // Set HEAD to point to a branch
2910
+ * await repo.symbolicRef('HEAD', 'refs/heads/main');
2911
+ * ```
2912
+ */
2913
+ symbolicRef(name: string, newRef?: string, opts?: ExecOpts): Promise<string | undefined>;
2914
+ /**
2915
+ * Git submodule operations
2916
+ *
2917
+ * Wraps: `git submodule *` commands
2918
+ */
2919
+ submodule: SubmoduleOperations;
2920
+ /**
2921
+ * Git remote operations
2922
+ *
2923
+ * Wraps: `git remote *` commands
2924
+ */
2925
+ remote: RemoteOperations;
2926
+ /**
2927
+ * Git config operations (repository-level)
2928
+ *
2929
+ * Wraps: `git config` (without --global)
2930
+ */
2931
+ config: ConfigOperations;
2932
+ }
2933
+ /**
2934
+ * Bare repository (no working directory)
2935
+ *
2936
+ * A bare repository contains only the Git data without a working tree.
2937
+ * Typically used for shared/server repositories.
2938
+ */
2939
+ interface BareRepo extends RepoBase {
2940
+ /** Path to the git directory */
2941
+ readonly gitDir: string;
2942
+ /**
2943
+ * Fetch from remote
2944
+ *
2945
+ * Wraps: `git fetch`
2946
+ */
2947
+ fetch(opts?: FetchOpts & ExecOpts): Promise<void>;
2948
+ /**
2949
+ * Push to remote
2950
+ *
2951
+ * Wraps: `git push`
2952
+ */
2953
+ push(opts?: PushOpts & ExecOpts): Promise<void>;
2954
+ /**
2955
+ * Remote operations
2956
+ *
2957
+ * Wraps: `git remote` subcommands
2958
+ */
2959
+ remote: RemoteOperations;
2960
+ /**
2961
+ * Config operations (repository-level)
2962
+ *
2963
+ * Wraps: `git config` subcommands
2964
+ */
2965
+ config: ConfigOperations;
2966
+ }
2967
+
2968
+ /**
2969
+ * Core Git interface - repository-agnostic operations
2970
+ */
2971
+
2972
+ /**
2973
+ * Options for git clone
2974
+ */
2975
+ type CloneOpts = {
2976
+ bare?: boolean;
2977
+ depth?: number;
2978
+ branch?: string;
2979
+ singleBranch?: boolean;
2980
+ mirror?: boolean;
2981
+ noCheckout?: boolean;
2982
+ recurseSubmodules?: boolean;
2983
+ /** Store .git directory at specified path instead of inside the repository */
2984
+ separateGitDir?: string;
2985
+ /**
2986
+ * Whether to clean up the target directory if the operation is aborted.
2987
+ * @default true
2988
+ */
2989
+ cleanupOnAbort?: boolean;
2990
+ /** Be more verbose */
2991
+ verbose?: boolean;
2992
+ /** Operate quietly (suppress progress reporting) */
2993
+ quiet?: boolean;
2994
+ /** Reject cloning a shallow repository */
2995
+ rejectShallow?: boolean;
2996
+ /** Clone from a local repository (use hard links) */
2997
+ local?: boolean;
2998
+ /** Don't use hard links for local clone */
2999
+ noHardlinks?: boolean;
3000
+ /** Share objects with a reference repository */
3001
+ shared?: boolean;
3002
+ /** Number of submodules to clone in parallel */
3003
+ jobs?: number;
3004
+ /** Directory with templates for the new repository */
3005
+ template?: string;
3006
+ /** Reference repository for object sharing */
3007
+ reference?: string;
3008
+ /** Reference repository if available (no error if not) */
3009
+ referenceIfAble?: string;
3010
+ /** Disconnect from reference repository after clone */
3011
+ dissociate?: boolean;
3012
+ /** Name of the remote (default: origin) */
3013
+ origin?: string;
3014
+ /** Create a shallow clone with commits since the specified date */
3015
+ shallowSince?: string | Date;
3016
+ /** Create a shallow clone excluding commits reachable from specified revision */
3017
+ shallowExclude?: string | string[];
3018
+ /** Don't clone any tags, and make later fetches not follow them */
3019
+ noTags?: boolean;
3020
+ /** Also clone submodules shallowly */
3021
+ shallowSubmodules?: boolean;
3022
+ /** Set config options for the new repository */
3023
+ config?: Record<string, string>;
3024
+ /** Use IPv4 addresses only */
3025
+ ipv4?: boolean;
3026
+ /** Use IPv6 addresses only */
3027
+ ipv6?: boolean;
3028
+ /** A partial clone filter specification (e.g., 'blob:none') */
3029
+ filter?: string;
3030
+ /** Also apply the partial clone filter to submodules */
3031
+ alsoFilterSubmodules?: boolean;
3032
+ /** Clone submodules from their remote tracking branch */
3033
+ remoteSubmodules?: boolean;
3034
+ /** Initialize sparse-checkout (clone only root files initially) */
3035
+ sparse?: boolean;
3036
+ };
3037
+ /**
3038
+ * Options for git init
3039
+ */
3040
+ type InitOpts = {
3041
+ bare?: boolean;
3042
+ initialBranch?: string;
3043
+ /** Store .git directory at specified path instead of inside the repository */
3044
+ separateGitDir?: string;
3045
+ /**
3046
+ * Whether to clean up the target directory if the operation is aborted.
3047
+ * @default true
3048
+ */
3049
+ cleanupOnAbort?: boolean;
3050
+ /** Directory with templates for the new repository */
3051
+ template?: string;
3052
+ /**
3053
+ * Set repository sharing level
3054
+ * - 'group': Group writable
3055
+ * - 'all'/'world'/'everybody': World readable
3056
+ * - number: Octal permissions
3057
+ */
3058
+ shared?: boolean | 'group' | 'all' | 'world' | 'everybody' | number;
3059
+ /** Operate quietly (suppress output) */
3060
+ quiet?: boolean;
3061
+ /** Specify the hash algorithm to use (sha1 or sha256) */
3062
+ objectFormat?: 'sha1' | 'sha256';
3063
+ };
3064
+ /**
3065
+ * Options for git ls-remote
3066
+ */
3067
+ type LsRemoteOpts = {
3068
+ /** Limit to refs/heads (branches) */
3069
+ heads?: boolean;
3070
+ /** Limit to refs/tags */
3071
+ tags?: boolean;
3072
+ /** Show only actual refs (not peeled tags) */
3073
+ refs?: boolean;
3074
+ /** Show remote URL instead of listing refs */
3075
+ getUrl?: boolean;
3076
+ /** Sort refs by the given key (e.g., 'version:refname') */
3077
+ sort?: string;
3078
+ /** Show symbolic refs in addition to object refs */
3079
+ symref?: boolean;
3080
+ };
3081
+ /**
3082
+ * Result from git ls-remote
3083
+ */
3084
+ type LsRemoteResult = {
3085
+ refs: Array<{
3086
+ hash: string;
3087
+ name: string;
3088
+ }>;
3089
+ };
3090
+ /**
3091
+ * Options for global LFS install
3092
+ *
3093
+ * Used with `git.lfs.install()` for user-level (~/.gitconfig) or
3094
+ * system-level (/etc/gitconfig) LFS configuration.
3095
+ *
3096
+ * @remarks
3097
+ * Internally runs `git lfs install` without `--local` flag.
3098
+ * For repository-level installation, use `repo.lfs.install()` instead.
3099
+ */
3100
+ type GlobalLfsInstallOpts = {
3101
+ /** Overwrite existing hooks */
3102
+ force?: boolean;
3103
+ /**
3104
+ * Install for all users (system-wide)
3105
+ *
3106
+ * @remarks
3107
+ * Internally adds `--system` flag to install to /etc/gitconfig
3108
+ * instead of ~/.gitconfig. Requires appropriate permissions.
3109
+ */
3110
+ system?: boolean;
3111
+ /** Skip smudge filter (don't download during checkout) */
3112
+ skipSmudge?: boolean;
3113
+ /** Skip repository setup (only install filters) */
3114
+ skipRepo?: boolean;
3115
+ /** Print commands instead of executing */
3116
+ manual?: boolean;
3117
+ };
3118
+ /**
3119
+ * Options for global LFS uninstall
3120
+ *
3121
+ * Used with `git.lfs.uninstall()` for user-level or system-level
3122
+ * LFS configuration removal.
3123
+ *
3124
+ * @remarks
3125
+ * Internally runs `git lfs uninstall` without `--local` flag.
3126
+ * For repository-level uninstallation, use `repo.lfs.uninstall()` instead.
3127
+ */
3128
+ type GlobalLfsUninstallOpts = {
3129
+ /**
3130
+ * Uninstall for all users (system-wide)
3131
+ *
3132
+ * @remarks
3133
+ * Internally adds `--system` flag to modify /etc/gitconfig
3134
+ * instead of ~/.gitconfig. Requires appropriate permissions.
3135
+ */
3136
+ system?: boolean;
3137
+ /** Skip repository cleanup */
3138
+ skipRepo?: boolean;
3139
+ };
3140
+ /**
3141
+ * Global LFS operations
3142
+ *
3143
+ * Wraps: `git lfs` subcommands for user-level configuration
3144
+ *
3145
+ * Operates on ~/.gitconfig (user-level) or /etc/gitconfig (system-level).
3146
+ * For repository-level LFS operations, use repo.lfs instead.
3147
+ */
3148
+ interface GlobalLfsOperations {
3149
+ /**
3150
+ * Install Git LFS hooks globally
3151
+ *
3152
+ * Wraps: `git lfs install`
3153
+ *
3154
+ * Sets up the clean and smudge filters under the name "lfs" in the
3155
+ * global Git config (~/.gitconfig) or system config (/etc/gitconfig).
3156
+ *
3157
+ * @example
3158
+ * ```typescript
3159
+ * // Install globally (to ~/.gitconfig)
3160
+ * await git.lfs.install();
3161
+ *
3162
+ * // Install system-wide (to /etc/gitconfig)
3163
+ * await git.lfs.install({ system: true });
3164
+ *
3165
+ * // Install with skip-smudge (manual LFS pull required)
3166
+ * await git.lfs.install({ skipSmudge: true });
3167
+ * ```
3168
+ */
3169
+ install(opts?: GlobalLfsInstallOpts & ExecOpts): Promise<void>;
3170
+ /**
3171
+ * Uninstall Git LFS hooks globally
3172
+ *
3173
+ * Wraps: `git lfs uninstall`
3174
+ *
3175
+ * Removes the clean and smudge filters from global or system config.
3176
+ *
3177
+ * @example
3178
+ * ```typescript
3179
+ * // Uninstall from global config
3180
+ * await git.lfs.uninstall();
3181
+ *
3182
+ * // Uninstall from system config
3183
+ * await git.lfs.uninstall({ system: true });
3184
+ * ```
3185
+ */
3186
+ uninstall(opts?: GlobalLfsUninstallOpts & ExecOpts): Promise<void>;
3187
+ /**
3188
+ * Get Git LFS version
3189
+ *
3190
+ * Wraps: `git lfs version`
3191
+ *
3192
+ * @returns LFS version string (e.g., "git-lfs/3.4.0")
3193
+ */
3194
+ version(opts?: ExecOpts): Promise<string>;
3195
+ }
3196
+ /**
3197
+ * Options for global config list
3198
+ */
3199
+ type GlobalConfigListOpts = {
3200
+ /** Show origin of each value */
3201
+ showOrigin?: boolean;
3202
+ /** Show scope of each value */
3203
+ showScope?: boolean;
3204
+ };
3205
+ /**
3206
+ * Global config operations
3207
+ *
3208
+ * Wraps: `git config --global` subcommands
3209
+ *
3210
+ * Operates on ~/.gitconfig (user-level configuration).
3211
+ * Uses the same typed ConfigSchema as repository-level config.
3212
+ */
3213
+ interface GlobalConfigOperations {
3214
+ /**
3215
+ * Get a typed global config value
3216
+ *
3217
+ * Wraps: `git config --global --get <key>`
3218
+ *
3219
+ * @returns Config value or undefined if not set
3220
+ */
3221
+ get<K extends ConfigKey>(key: K, opts?: ExecOpts): Promise<ConfigSchema[K] | undefined>;
3222
+ /**
3223
+ * Get all values for a typed multi-valued global config key
3224
+ *
3225
+ * Wraps: `git config --global --get-all <key>`
3226
+ */
3227
+ getAll<K extends ConfigKey>(key: K, opts?: ExecOpts): Promise<ConfigSchema[K][]>;
3228
+ /**
3229
+ * Set a typed global config value
3230
+ *
3231
+ * Wraps: `git config --global <key> <value>`
3232
+ */
3233
+ set<K extends ConfigKey>(key: K, value: ConfigSchema[K], opts?: ExecOpts): Promise<void>;
3234
+ /**
3235
+ * Add a value to a typed multi-valued global config key
3236
+ *
3237
+ * Wraps: `git config --global --add <key> <value>`
3238
+ */
3239
+ add<K extends ConfigKey>(key: K, value: ConfigSchema[K], opts?: ExecOpts): Promise<void>;
3240
+ /**
3241
+ * Unset a typed global config value
3242
+ *
3243
+ * Wraps: `git config --global --unset <key>`
3244
+ */
3245
+ unset<K extends ConfigKey>(key: K, opts?: ExecOpts): Promise<void>;
3246
+ /**
3247
+ * Get a raw global config value (for arbitrary keys)
3248
+ *
3249
+ * Wraps: `git config --global --get <key>`
3250
+ *
3251
+ * @returns Config value or undefined if not set
3252
+ */
3253
+ getRaw(key: string, opts?: ConfigGetOpts & ExecOpts): Promise<string | string[] | undefined>;
3254
+ /**
3255
+ * Set a raw global config value (for arbitrary keys)
3256
+ *
3257
+ * Wraps: `git config --global <key> <value>`
3258
+ */
3259
+ setRaw(key: string, value: string, opts?: ConfigSetOpts & ExecOpts): Promise<void>;
3260
+ /**
3261
+ * Unset a raw global config value (for arbitrary keys)
3262
+ *
3263
+ * Wraps: `git config --global --unset <key>`
3264
+ */
3265
+ unsetRaw(key: string, opts?: ExecOpts): Promise<void>;
3266
+ /**
3267
+ * List all global config values
3268
+ *
3269
+ * Wraps: `git config --global --list`
3270
+ */
3271
+ list(opts?: GlobalConfigListOpts & ExecOpts): Promise<ConfigEntry[]>;
3272
+ }
3273
+ /**
3274
+ * Main Git interface for repository-agnostic operations
3275
+ *
3276
+ * Provides type-safe wrappers for Git commands that don't require a repository context.
3277
+ * Each method corresponds to a specific Git CLI command.
3278
+ */
3279
+ interface Git {
3280
+ /**
3281
+ * Open an existing worktree repository
3282
+ *
3283
+ * This is the most common use case. Throws GitError if the repository is bare.
3284
+ *
3285
+ * @param path - Path to the repository working directory
3286
+ * @param opts - Environment isolation and credential options
3287
+ * @returns WorktreeRepo
3288
+ * @throws GitError with kind 'NotWorktreeRepo' if the repository is bare
3289
+ */
3290
+ open(path: string, opts?: GitOpenOptions): Promise<WorktreeRepo>;
3291
+ /**
3292
+ * Open an existing bare repository
3293
+ *
3294
+ * Throws GitError if the repository is not bare.
3295
+ *
3296
+ * @param path - Path to the bare repository (git-dir)
3297
+ * @param opts - Environment isolation and credential options
3298
+ * @returns BareRepo
3299
+ * @throws GitError with kind 'NotBareRepo' if the repository is not bare
3300
+ */
3301
+ openBare(path: string, opts?: GitOpenOptions): Promise<BareRepo>;
3302
+ /**
3303
+ * Open an existing repository without type guarantee
3304
+ *
3305
+ * Returns either WorktreeRepo or BareRepo depending on the repository type.
3306
+ * Use this when you don't know the repository type at compile time.
3307
+ * You can use `isWorktree()` or `isBare()` methods for runtime type checking.
3308
+ *
3309
+ * @param path - Path to the repository (workdir or git-dir)
3310
+ * @param opts - Environment isolation and credential options
3311
+ * @returns WorktreeRepo or BareRepo depending on repository type
3312
+ *
3313
+ * @example
3314
+ * ```typescript
3315
+ * const repo = await git.openRaw('/path/to/repo');
3316
+ * if (await repo.isWorktree()) {
3317
+ * // repo is WorktreeRepo at runtime
3318
+ * const status = await (repo as WorktreeRepo).status();
3319
+ * } else if (await repo.isBare()) {
3320
+ * // repo is BareRepo at runtime
3321
+ * await (repo as BareRepo).fetch({ remote: 'origin' });
3322
+ * }
3323
+ * ```
3324
+ */
3325
+ openRaw(path: string, opts?: GitOpenOptions): Promise<WorktreeRepo | BareRepo>;
3326
+ /**
3327
+ * Clone a repository
3328
+ *
3329
+ * Wraps: `git clone <url> <path>`
3330
+ *
3331
+ * The return type depends on the `bare` or `mirror` option:
3332
+ * - `{ bare: true }` or `{ mirror: true }` → `BareRepo`
3333
+ * - Otherwise → `WorktreeRepo`
3334
+ */
3335
+ clone(url: string, path: string, opts: CloneOpts & {
3336
+ bare: true;
3337
+ } & ExecOpts): Promise<BareRepo>;
3338
+ clone(url: string, path: string, opts: CloneOpts & {
3339
+ mirror: true;
3340
+ } & ExecOpts): Promise<BareRepo>;
3341
+ clone(url: string, path: string, opts?: CloneOpts & ExecOpts): Promise<WorktreeRepo>;
3342
+ /**
3343
+ * Initialize a new repository
3344
+ *
3345
+ * Wraps: `git init <path>`
3346
+ *
3347
+ * The return type depends on the `bare` option:
3348
+ * - `{ bare: true }` → `BareRepo`
3349
+ * - Otherwise → `WorktreeRepo`
3350
+ */
3351
+ init(path: string, opts: InitOpts & {
3352
+ bare: true;
3353
+ } & ExecOpts): Promise<BareRepo>;
3354
+ init(path: string, opts?: InitOpts & ExecOpts): Promise<WorktreeRepo>;
3355
+ /**
3356
+ * List references in a remote repository
3357
+ *
3358
+ * Wraps: `git ls-remote <url>`
3359
+ */
3360
+ lsRemote(url: string, opts?: LsRemoteOpts & ExecOpts): Promise<LsRemoteResult>;
3361
+ /**
3362
+ * Get git version
3363
+ *
3364
+ * Wraps: `git --version`
3365
+ */
3366
+ version(opts?: ExecOpts): Promise<string>;
3367
+ /**
3368
+ * Execute a raw git command (repository-agnostic)
3369
+ *
3370
+ * Wraps: `git <argv...>`
3371
+ */
3372
+ raw(argv: string[], opts?: ExecOpts): Promise<RawResult>;
3373
+ /**
3374
+ * Global config operations
3375
+ *
3376
+ * Wraps: `git config --global` subcommands
3377
+ *
3378
+ * Operates on ~/.gitconfig (user-level configuration).
3379
+ * For repository-level config, use repo.config instead.
3380
+ */
3381
+ config: GlobalConfigOperations;
3382
+ /**
3383
+ * Global LFS operations
3384
+ *
3385
+ * Wraps: `git lfs` subcommands for user-level configuration
3386
+ *
3387
+ * Operates on ~/.gitconfig (user-level) or /etc/gitconfig (system-level).
3388
+ * For repository-level LFS operations, use repo.lfs instead.
3389
+ */
3390
+ lfs: GlobalLfsOperations;
3391
+ }
3392
+
3393
+ /**
3394
+ * CLI Runner - Core execution engine for Git commands
3395
+ *
3396
+ * This module provides:
3397
+ * - CliRunner: Executes Git commands with progress tracking and abort support
3398
+ * - Progress collection from stderr (Git and LFS)
3399
+ * - Error mapping from Git exit codes
3400
+ */
3401
+
3402
+ /**
3403
+ * Credential helper configuration
3404
+ */
3405
+ type CredentialHelperConfig = {
3406
+ /** Helper name (e.g., 'store', 'cache', 'manager-core', or custom name) */
3407
+ helper?: string;
3408
+ /** Path to custom helper binary */
3409
+ helperPath?: string;
3410
+ };
3411
+ /**
3412
+ * Options for CliRunner
3413
+ */
3414
+ type CliRunnerOptions = {
3415
+ /** Git binary path (default: 'git') */
3416
+ gitBinary?: string;
3417
+ /** Additional environment variables */
3418
+ env?: Record<string, string>;
3419
+ /** Directories to prepend to PATH */
3420
+ pathPrefix?: string[];
3421
+ /** Custom HOME directory for git config isolation */
3422
+ home?: string;
3423
+ /** Credential helper configuration */
3424
+ credential?: CredentialHelperConfig;
3425
+ };
3426
+ /**
3427
+ * CLI Runner for executing Git commands
3428
+ *
3429
+ * Handles:
3430
+ * - Command construction based on execution context
3431
+ * - Progress tracking from stderr (Git and LFS)
3432
+ * - Abort signal handling
3433
+ * - Error mapping
3434
+ */
3435
+ declare class CliRunner {
3436
+ private readonly exec;
3437
+ private readonly gitBinary;
3438
+ private readonly baseEnv;
3439
+ private readonly pathPrefix;
3440
+ private readonly home;
3441
+ private readonly credential;
3442
+ constructor(adapters: RuntimeAdapters, options?: CliRunnerOptions);
3443
+ /**
3444
+ * Create a new CliRunner with additional options merged
3445
+ *
3446
+ * Used to create a runner for a specific repository with custom environment
3447
+ */
3448
+ withOptions(options: CliRunnerOptions): CliRunner;
3449
+ /**
3450
+ * Build command argv based on execution context
3451
+ */
3452
+ private buildArgv;
3453
+ /**
3454
+ * Build the effective environment for command execution
3455
+ *
3456
+ * Applies home directory and PATH prefix overrides
3457
+ */
3458
+ private buildEnv;
3459
+ /**
3460
+ * Extract directory from a file path
3461
+ */
3462
+ private extractDirectory;
3463
+ /**
3464
+ * Run a Git command
3465
+ */
3466
+ run(context: ExecutionContext, args: string[], opts?: ExecOpts): Promise<RawResult>;
3467
+ /**
3468
+ * Map Git result to GitError if needed
3469
+ */
3470
+ mapError(result: RawResult, context: ExecutionContext, argv: string[]): GitError | null;
3471
+ /**
3472
+ * Classify error type based on stderr content
3473
+ */
3474
+ private classifyError;
3475
+ /**
3476
+ * Extract user-friendly error message from stderr
3477
+ */
3478
+ private extractErrorMessage;
3479
+ /**
3480
+ * Run a command and throw on error
3481
+ */
3482
+ runOrThrow(context: ExecutionContext, args: string[], opts?: ExecOpts): Promise<RawResult>;
3483
+ }
3484
+
3485
+ /**
3486
+ * Git implementation - repository-agnostic operations
3487
+ */
3488
+
3489
+ /**
3490
+ * Options for creating a Git instance
3491
+ */
3492
+ type CreateGitOptions = CliRunnerOptions & {
3493
+ /** Runtime adapters (exec, fs) */
3494
+ adapters: RuntimeAdapters;
3495
+ };
3496
+ /**
3497
+ * Create a new Git instance
3498
+ *
3499
+ * @param options - Creation options including runtime adapters
3500
+ * @returns Git instance
3501
+ */
3502
+ declare function createGit(options: CreateGitOptions): Git;
3503
+
3504
+ /**
3505
+ * Node.js ExecAdapter implementation
3506
+ */
3507
+
3508
+ declare class NodeExecAdapter implements ExecAdapter {
3509
+ getCapabilities(): Capabilities;
3510
+ spawn(options: SpawnOptions, handlers?: StreamHandler): Promise<SpawnResult>;
3511
+ spawnStreaming(options: SpawnOptions): SpawnHandle;
3512
+ }
3513
+
3514
+ /**
3515
+ * Node.js FsAdapter implementation
3516
+ */
3517
+
3518
+ declare class NodeFsAdapter implements FsAdapter {
3519
+ createTempFile(prefix?: string): Promise<string>;
3520
+ tail(options: TailOptions): Promise<void>;
3521
+ deleteFile(filePath: string): Promise<void>;
3522
+ deleteDirectory(dirPath: string): Promise<void>;
3523
+ exists(filePath: string): Promise<boolean>;
3524
+ readFile(filePath: string): Promise<string>;
3525
+ writeFile(filePath: string, contents: string): Promise<void>;
3526
+ tailStreaming(filePath: string, options?: {
3527
+ signal?: AbortSignal;
3528
+ pollInterval?: number;
3529
+ }): TailHandle;
3530
+ }
3531
+
3532
+ /**
3533
+ * Node.js adapter exports
3534
+ */
3535
+
3536
+ /**
3537
+ * Create Node.js runtime adapters
3538
+ */
3539
+ declare function createNodeAdapters(): RuntimeAdapters;
3540
+ /**
3541
+ * Options for creating a TypeGit instance (Node.js)
3542
+ * Excludes adapters as they are automatically configured
3543
+ */
3544
+ type TypeGitOptions = Omit<CreateGitOptions, 'adapters'>;
3545
+ /**
3546
+ * Pre-configured Git client for Node.js
3547
+ *
3548
+ * This is a convenience class that automatically configures Node.js adapters.
3549
+ *
3550
+ * @example
3551
+ * ```typescript
3552
+ * import { TypeGit } from 'type-git/node';
3553
+ *
3554
+ * const git = new TypeGit();
3555
+ * const repo = await git.open('/path/to/repo');
3556
+ * ```
3557
+ */
3558
+ declare class TypeGit {
3559
+ private readonly git;
3560
+ constructor(options?: TypeGitOptions);
3561
+ /**
3562
+ * Open an existing worktree repository
3563
+ *
3564
+ * This is the most common use case. Throws GitError if the repository is bare.
3565
+ *
3566
+ * @throws GitError with kind 'NotWorktreeRepo' if the repository is bare
3567
+ */
3568
+ get open(): (path: string, opts?: GitOpenOptions) => Promise<WorktreeRepo>;
3569
+ /**
3570
+ * Open an existing bare repository
3571
+ *
3572
+ * Throws GitError if the repository is not bare.
3573
+ *
3574
+ * @throws GitError with kind 'NotBareRepo' if the repository is not bare
3575
+ */
3576
+ get openBare(): (path: string, opts?: GitOpenOptions) => Promise<BareRepo>;
3577
+ /**
3578
+ * Open an existing repository without type guarantee
3579
+ *
3580
+ * Returns either WorktreeRepo or BareRepo depending on the repository type.
3581
+ * Use this when you don't know the repository type at compile time.
3582
+ */
3583
+ get openRaw(): (path: string, opts?: GitOpenOptions) => Promise<WorktreeRepo | BareRepo>;
3584
+ /**
3585
+ * Clone a repository
3586
+ *
3587
+ * The return type depends on the `bare` or `mirror` option:
3588
+ * - `{ bare: true }` or `{ mirror: true }` → `BareRepo`
3589
+ * - Otherwise → `WorktreeRepo`
3590
+ */
3591
+ clone(url: string, path: string, opts: CloneOpts & {
3592
+ bare: true;
3593
+ } & ExecOpts): Promise<BareRepo>;
3594
+ clone(url: string, path: string, opts: CloneOpts & {
3595
+ mirror: true;
3596
+ } & ExecOpts): Promise<BareRepo>;
3597
+ clone(url: string, path: string, opts?: CloneOpts & ExecOpts): Promise<WorktreeRepo>;
3598
+ /**
3599
+ * Initialize a new repository
3600
+ *
3601
+ * The return type depends on the `bare` option:
3602
+ * - `{ bare: true }` → `BareRepo`
3603
+ * - Otherwise → `WorktreeRepo`
3604
+ */
3605
+ init(path: string, opts: InitOpts & {
3606
+ bare: true;
3607
+ } & ExecOpts): Promise<BareRepo>;
3608
+ init(path: string, opts?: InitOpts & ExecOpts): Promise<WorktreeRepo>;
3609
+ /**
3610
+ * List references in a remote repository
3611
+ */
3612
+ get lsRemote(): (url: string, opts?: LsRemoteOpts & ExecOpts) => Promise<LsRemoteResult>;
3613
+ /**
3614
+ * Get git version
3615
+ */
3616
+ get version(): (opts?: ExecOpts) => Promise<string>;
3617
+ /**
3618
+ * Execute a raw git command (repository-agnostic)
3619
+ */
3620
+ get raw(): (argv: string[], opts?: ExecOpts) => Promise<RawResult>;
3621
+ /**
3622
+ * Global config operations
3623
+ *
3624
+ * Operates on ~/.gitconfig (user-level configuration).
3625
+ * For repository-level config, use repo.config instead.
3626
+ */
3627
+ get config(): GlobalConfigOperations;
3628
+ /**
3629
+ * Global LFS operations
3630
+ *
3631
+ * Operates on ~/.gitconfig (user-level) or /etc/gitconfig (system-level).
3632
+ * For repository-level LFS operations, use repo.lfs instead.
3633
+ *
3634
+ * @example
3635
+ * ```typescript
3636
+ * // Install LFS globally
3637
+ * await git.lfs.install();
3638
+ *
3639
+ * // Install system-wide
3640
+ * await git.lfs.install({ system: true });
3641
+ *
3642
+ * // Get LFS version
3643
+ * const version = await git.lfs.version();
3644
+ * ```
3645
+ */
3646
+ get lfs(): GlobalLfsOperations;
3647
+ }
3648
+
3649
+ export { type CherryPickOpts as $, type AddOpts as A, type BranchInfo as B, type CreateGitOptions as C, type DiffOpts as D, type DiffEntry as E, type FetchOpts as F, type GlobalLfsInstallOpts as G, type DiffResult as H, type InitOpts as I, type MergeResult as J, type PullOpts as K, type LsRemoteOpts as L, type MergeOpts as M, NodeExecAdapter as N, type ResetOpts as O, type PushOpts as P, type RmOpts as Q, type RepoBase as R, type StatusEntry as S, type TypeGitOptions as T, type StashEntry as U, type StashPushOpts as V, type StashApplyOpts as W, type SwitchOpts as X, type TagInfo as Y, type TagListOpts as Z, type TagCreateOpts as _, CliRunner as a, type ConfigGetOpts as a$, type CleanOpts as a0, type MvOpts as a1, type RebaseOpts as a2, type RestoreOpts as a3, type RevertOpts as a4, type ShowOpts as a5, type SubmoduleOpts as a6, type SubmoduleAddOpts as a7, type SubmoduleDeinitOpts as a8, type SubmoduleStatusOpts as a9, type LfsPreUploadOpts as aA, type LfsPreUploadResult as aB, type LfsPreDownloadOpts as aC, type LfsPreDownloadResult as aD, type Worktree as aE, type WorktreeAddOpts as aF, type WorktreeRemoveOpts as aG, type WorktreePruneOpts as aH, type WorktreeMoveOpts as aI, type WorktreeRepairOpts as aJ, type WorktreeLockOpts as aK, type WorktreeOperations as aL, type LfsOperations as aM, type LfsExtraOperations as aN, type BranchOperations as aO, type StashOperations as aP, type TagOperations as aQ, type RemoteInfo as aR, type RemoteAddOpts as aS, type RemoteSetHeadOpts as aT, type RemoteShowOpts as aU, type RemotePruneOpts as aV, type RemoteUpdateOpts as aW, type RemoteSetBranchesOpts as aX, type RemoteUrlOpts as aY, type RemoteOperations as aZ, type ConfigEntry as a_, type SubmoduleSummaryOpts as aa, type SubmoduleForeachOpts as ab, type SubmoduleSyncOpts as ac, type SubmoduleSetBranchOpts as ad, type SubmoduleInfo as ae, type LfsStatus as af, type LfsPullOpts as ag, type LfsPushOpts as ah, type LfsStatusOpts as ai, type LfsPruneOpts as aj, type LfsFetchOpts as ak, type RepoLfsInstallOpts as al, type RepoLfsUninstallOpts as am, type LfsFileEntry as an, type LfsLsFilesOpts as ao, type LfsTrackEntry as ap, type LfsTrackOpts as aq, type LfsLockEntry as ar, type LfsLockOpts as as, type LfsUnlockOpts as at, type LfsLocksOpts as au, type LfsCheckoutOpts as av, type LfsMigrateInfoOpts as aw, type LfsMigrateImportOpts as ax, type LfsMigrateExportOpts as ay, type LfsEnvInfo as az, type CliRunnerOptions as b, type ConfigSetOpts as b0, type ConfigListOpts as b1, type ConfigSchema as b2, type ConfigKey as b3, type ConfigOperations as b4, type SubmoduleOperations as b5, type WorktreeRepo as b6, type BareRepo as b7, createGit as c, createNodeAdapters as d, TypeGit as e, NodeFsAdapter as f, type CloneOpts as g, type LsRemoteResult as h, type GlobalLfsUninstallOpts as i, type GlobalLfsOperations as j, type GlobalConfigListOpts as k, type GlobalConfigOperations as l, type Git as m, type StatusPorcelain as n, type StatusOpts as o, type Commit as p, type LogOpts as q, type ForceWithLeaseOpts as r, type BranchOpts as s, type BranchCreateOpts as t, type BranchDeleteOpts as u, type CheckoutBranchOpts as v, type CheckoutPathOpts as w, type CheckoutOpts as x, type CommitOpts as y, type CommitResult as z };