Module: Git::Commands::Worktree Private

Defined in:
lib/git/commands/worktree.rb,
lib/git/commands/worktree/add.rb,
lib/git/commands/worktree/list.rb,
lib/git/commands/worktree/lock.rb,
lib/git/commands/worktree/move.rb,
lib/git/commands/worktree/prune.rb,
lib/git/commands/worktree/remove.rb,
lib/git/commands/worktree/repair.rb,
lib/git/commands/worktree/unlock.rb,
lib/git/commands/worktree/management_base.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Implements git worktree subcommands for managing multiple working trees

Split into subclasses because each subcommand has a distinct call shape and option set:

  • Add — create a new linked worktree
  • List — list all worktrees
  • Lock — prevent a worktree from being pruned
  • Move — move a worktree to a new location
  • Prune — prune stale worktree administrative files
  • Remove — remove a worktree
  • Repair — repair worktree administrative files
  • Unlock — allow a worktree to be pruned

Management subcommands (Add, Lock, Move, Prune, Remove, Repair, Unlock) inherit from 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.

Defined Under Namespace

Classes: Add, List, Lock, ManagementBase, Move, Prune, Remove, Repair, Unlock