class Git::Worktree

A worktree in a Git repository

Represents a single linked or main worktree. Constructed by {Git::Repository::WorktreeOperations#worktree} or populated by {Git::Worktrees}.

@example Add and remove a linked worktree

worktree = repo.worktree('/path/to/new-worktree')
worktree.add
worktree.remove

@deprecated Use {Git::Repository::WorktreeOperations#worktree_list} and the

path-based worktree operations on {Git::Repository} instead

{Git::Repository::WorktreeOperations#worktree_list} returns immutable
{Git::WorktreeInfo} value objects. Operations that lived on this class are
called on the repository with the worktree path instead (for example
{Git::Repository::WorktreeOperations#worktree_add} and
{Git::Repository::WorktreeOperations#worktree_remove}). {#gcommit},
{#add}, and {#remove} each emit a deprecation warning; the `dir`, `full`,
`to_s`, and `to_a` readers do not.

@api public