MCPcopy Create free account
hub / github.com/cli/cli / WorktreeRemove

Method WorktreeRemove

git/client.go:276–283  ·  view source on GitHub ↗

WorktreeRemove removes the worktree at the given path via `git worktree remove `.

(ctx context.Context, path string)

Source from the content-addressed store, hash-verified

274// WorktreeRemove removes the worktree at the given path via
275// `git worktree remove <path>`.
276func (c *Client) WorktreeRemove(ctx context.Context, path string) error {
277 cmd, err := c.Command(ctx, "worktree", "remove", "--", path)
278 if err != nil {
279 return err
280 }
281 _, err = cmd.Output()
282 return err
283}
284
285// WorktreePrune removes administrative files for worktrees that no longer
286// exist on disk.

Calls 2

CommandMethod · 0.95
OutputMethod · 0.65