From: Junio C Hamano Date: Fri, 24 Feb 2017 18:48:10 +0000 (-0800) Subject: Merge branch 'bc/worktree-doc-fix-detached' X-Git-Tag: v2.12.0~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/dc9ded480245c1014b526c4b951d1acb3a60d3fa?ds=inline;hp=-c Merge branch 'bc/worktree-doc-fix-detached' Doc update. * bc/worktree-doc-fix-detached: Documentation: correctly spell git worktree --detach --- dc9ded480245c1014b526c4b951d1acb3a60d3fa diff --combined Documentation/git-worktree.txt index e257c19ebe,190e269515..553cf8413f --- a/Documentation/git-worktree.txt +++ b/Documentation/git-worktree.txt @@@ -9,11 -9,8 +9,11 @@@ git-worktree - Manage multiple working SYNOPSIS -------- [verse] -'git worktree add' [-f] [--detach] [-b ] [] +'git worktree add' [-f] [--detach] [--checkout] [-b ] [] +'git worktree list' [--porcelain] +'git worktree lock' [--reason ] 'git worktree prune' [-n] [-v] [--expire ] +'git worktree unlock' DESCRIPTION ----------- @@@ -30,18 -27,21 +30,18 @@@ bare repository) and zero or more linke When you are done with a linked working tree you can simply delete it. The working tree's administrative files in the repository (see "DETAILS" below) will eventually be removed automatically (see -`gc.worktreePruneExpire` in linkgit::git-config[1]), or you can run +`gc.worktreePruneExpire` in linkgit:git-config[1]), or you can run `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 to another file system, or -within a file system that does not support hard links, you need to run -at least one git command inside the linked working tree -(e.g. `git status`) in order to update its administrative files in the -repository so that they do not get automatically pruned. +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 creating a file named 'locked' alongside the other -administrative files, optionally containing a plain text reason that -pruning should be suppressed. See section "DETAILS" for more information. +being pruned by issuing the `git worktree lock` command, optionally +specifying `--reason` to explain why the working tree is locked. COMMANDS -------- @@@ -49,36 -49,16 +49,36 @@@ add []: Create `` and checkout `` into it. The new working directory is linked to the current repository, sharing everything except working -directory specific files such as HEAD, index, etc. +directory specific files such as HEAD, index, etc. `-` may also be +specified as ``; it is synonymous with `@{-1}`. + - If `` is omitted and neither `-b` nor `-B` nor `--detached` used, + If `` is omitted and neither `-b` nor `-B` nor `--detach` used, then, as a convenience, a new branch based at HEAD is created automatically, as if `-b $(basename )` was specified. +list:: + +List details of each worktree. The main worktree is listed first, followed by +each of the linked worktrees. The output details include if the worktree is +bare, the revision currently checked out, and the branch currently checked out +(or 'detached HEAD' if none). + +lock:: + +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. This also prevents it from +being moved or deleted. Optionally, specify a reason for the lock +with `--reason`. + prune:: Prune working tree information in $GIT_DIR/worktrees. +unlock:: + +Unlock a working tree, allowing it to be pruned, moved or deleted. + OPTIONS ------- @@@ -101,22 -81,11 +101,22 @@@ With `add`, detach HEAD in the new working tree. See "DETACHED HEAD" in linkgit:git-checkout[1]. +--[no-]checkout:: + By default, `add` checks out ``, however, `--no-checkout` can + be used to suppress checkout in order to make customizations, + such as configuring sparse-checkout. See "Sparse checkout" + in linkgit:git-read-tree[1]. + -n:: --dry-run:: With `prune`, do not remove anything; just report what it would remove. +--porcelain:: + With `list`, output in an easy-to-parse format for scripts. + This format will remain stable across Git versions and regardless of user + configuration. See below for details. + -v:: --verbose:: With `prune`, report all removals. @@@ -124,18 -93,6 +124,18 @@@ --expire