Add worktree command (#255945)

* Basic functionality of adding worktree

* Code refactoring and clean up

* Remove accidentally added submodules

* Specify folder destination

* Remove default worktree path, always prompt for destination instead

* create worktree only displayed in repo's worktree subcommands

* Git - handle another error condition when detecting worktrees (#256278)

* Rework creating worktree flow

* Include worktree name placeholder

---------

Co-authored-by: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com>
This commit is contained in:
Christy 😺
2025-07-16 11:54:45 -07:00
committed by GitHub
parent b9e82f6b60
commit 72aaf2bc9f
6 changed files with 102 additions and 3 deletions

View File

@@ -2033,6 +2033,11 @@ export class Repository {
await this.exec(args);
}
async worktree(options: { path: string; name: string }): Promise<void> {
const args = ['worktree', 'add', options.path, options.name];
await this.exec(args);
}
async deleteWorktree(path: string): Promise<void> {
const args = ['worktree', 'remove', path];
await this.exec(args);