"git worktree" learned move and remove subcommands.
* nd/worktree-move:
t2028: fix minor error and issues in newly-added "worktree move" tests
worktree remove: allow it when $GIT_WORK_TREE is already gone
worktree remove: new command
worktree move: refuse to move worktrees with submodules
worktree move: accept destination as directory
worktree move: new command
worktree.c: add update_worktree_location()
worktree.c: add validate_worktree()
@ -34,10 +36,6 @@ The working tree's administrative files in the repository (see
@@ -34,10 +36,6 @@ The working tree's administrative files in the repository (see
`git worktree prune` in the main or any linked working tree to
clean up any stale administrative files.
If you move a linked working tree, you need to manually update the
administrative files so that they do not get pruned automatically. See
section "DETAILS" for more information.
If a linked working tree is stored on a portable device or network share
which is not always mounted, you can prevent its administrative files from
being pruned by issuing the `git worktree lock` command, optionally
@ -80,10 +78,22 @@ files from being pruned automatically. This also prevents it from
@@ -80,10 +78,22 @@ files from being pruned automatically. This also prevents it from
being moved or deleted. Optionally, specify a reason for the lock
with `--reason`.
move::
Move a working tree to a new location. Note that the main working tree
or linked working trees containing submodules cannot be moved.
prune::
Prune working tree information in $GIT_DIR/worktrees.
remove::
Remove a working tree. Only clean working trees (no untracked files
and no modification in tracked files) can be removed. Unclean working
trees or ones with submodules can be removed with `--force`. The main
working tree cannot be removed.
unlock::
Unlock a working tree, allowing it to be pruned, moved or deleted.
By default, `add` refuses to create a new working tree when `<commit-ish>` is a branch name and
is already checked out by another working tree. This option overrides
that safeguard.
By default, `add` refuses to create a new working tree when
`<commit-ish>` is a branch name and is already checked out by
another working tree and `remove` refuses to remove an unclean
working tree. This option overrides that safeguard.
-b <new-branch>::
-B <new-branch>::
@ -197,7 +208,7 @@ thumb is do not make any assumption about whether a path belongs to
@@ -197,7 +208,7 @@ thumb is do not make any assumption about whether a path belongs to
$GIT_DIR or $GIT_COMMON_DIR when you need to directly access something
inside $GIT_DIR. Use `git rev-parse --git-path` to get the final path.
If you move a linked working tree, you need to update the 'gitdir' file
If you manually move a linked working tree, you need to update the 'gitdir' file
in the entry's directory. For example, if a linked working tree is moved
to `/newpath/test-next` and its `.git` file points to
`/path/main/.git/worktrees/test-next`, then update
@ -277,13 +288,6 @@ Multiple checkout in general is still experimental, and the support
@@ -277,13 +288,6 @@ Multiple checkout in general is still experimental, and the support
for submodules is incomplete. It is NOT recommended to make multiple
checkouts of a superproject.
git-worktree could provide more automation for tasks currently
performed manually, such as:
- `remove` to remove a linked working tree and its administrative files (and
warn if the working tree is dirty)
- `mv` to move or rename a working tree and update its administrative files