git worktree lock <worktree>

If a working tree is on a portable device or network share which is not always mounted, lock it to prevent its administrative files from being pruned automatically

Arguments

NameDescription
worktreeWorking trees can be identified by path, either relative or absolute

Options

NameDescription
--reason <reason>With lock or with add --lock, an explanation <reason> why the working tree is locked