WorktreeOperations
Defined in: src/core/repo.ts:2222
Worktree operations
Wraps: git worktree subcommands
Methods
add()
add(
path,opts?):Promise<WorktreeRepo>
Defined in: src/core/repo.ts:2237
Add a new worktree and return a repository object for it
Wraps: git worktree add <path>
Parameters
path
string
opts?
Returns
Promise<WorktreeRepo>
A WorktreeRepo instance for the newly created worktree
list()
list(
opts?):Promise<Worktree[]>
Defined in: src/core/repo.ts:2228
List all worktrees
Wraps: git worktree list --porcelain
Parameters
opts?
Returns
Promise<Worktree[]>
lock()
lock(
path,opts?):Promise<void>
Defined in: src/core/repo.ts:2258
Lock a worktree
Wraps: git worktree lock <path>
Parameters
path
string
opts?
Returns
Promise<void>
move()
move(
src,dst,opts?):Promise<WorktreeRepo>
Defined in: src/core/repo.ts:2274
Move a worktree to a new location and return a repository object for it
Wraps: git worktree move <src> <dst>
Parameters
src
string
dst
string
opts?
Returns
Promise<WorktreeRepo>
A WorktreeRepo instance for the worktree at the new location
prune()
prune(
opts?):Promise<string[]>
Defined in: src/core/repo.ts:2251
Prune stale worktree references
Wraps: git worktree prune
Parameters
opts?
Returns
Promise<string[]>
remove()
remove(
path,opts?):Promise<void>
Defined in: src/core/repo.ts:2244
Remove a worktree
Wraps: git worktree remove <path>
Parameters
path
string
opts?
Returns
Promise<void>
repair()
repair(
paths?,opts?):Promise<void>
Defined in: src/core/repo.ts:2281
Repair worktree administrative files
Wraps: git worktree repair
Parameters
paths?
string[]
opts?
Returns
Promise<void>
unlock()
unlock(
path,opts?):Promise<void>
Defined in: src/core/repo.ts:2265
Unlock a worktree
Wraps: git worktree unlock <path>
Parameters
path
string
opts?
Returns
Promise<void>