module Git::Commands::Worktree
Implements βgit worktree` subcommands for managing multiple working trees
Split into subclasses because each subcommand has a distinct call shape and option set:
-
{Worktree::Add} β create a new linked worktree
-
{Worktree::List} β list all worktrees
-
{Worktree::Lock} β prevent a worktree from being pruned
-
{Worktree::Move} β move a worktree to a new location
-
{Worktree::Prune} β prune stale worktree administrative files
-
{Worktree::Remove} β remove a worktree
-
{Worktree::Repair} β repair worktree administrative files
-
{Worktree::Unlock} β allow a worktree to be pruned
Management subcommands ({Add}, {Lock}, {Move}, {Prune}, {Remove}, {Repair}, {Unlock}) inherit from {Worktree::ManagementBase}, which unconditionally unsets βGIT_INDEX_FILE` in the subprocess environment. Git worktrees maintain their own index files; leaving `GIT_INDEX_FILE` set causes silent corruption of both the main and the linked worktree indexes.
@see git-scm.com/docs/git-worktree git-worktree documentation
@api private