t/lib-submodule-update.sh: fix test ignoring ignored files in submodules
[gitweb.git] / Documentation / git-worktree.txt
index 121895209d96f966987cd66ee4c5c17b6f172b1d..f850e8ffb66a41d8d76c0cc67967f7a27782bc3c 100644 (file)
@@ -52,6 +52,14 @@ is linked to the current repository, sharing everything except working
 directory specific files such as HEAD, index, etc. `-` may also be
 specified as `<commit-ish>`; it is synonymous with `@{-1}`.
 +
+If <commit-ish> is a branch name (call it `<branch>` and is not found,
+and neither `-b` nor `-B` nor `--detach` are used, but there does
+exist a tracking branch in exactly one remote (call it `<remote>`)
+with a matching name, treat as equivalent to
+------------
+$ git worktree add --track -b <branch> <path> <remote>/<branch>
+------------
++
 If `<commit-ish>` 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 <path>)` was specified.
@@ -107,6 +115,22 @@ OPTIONS
        such as configuring sparse-checkout. See "Sparse checkout"
        in linkgit:git-read-tree[1].
 
+--[no-]guess-remote::
+       With `worktree add <path>`, without `<commit-ish>`, instead
+       of creating a new branch from HEAD, if there exists a tracking
+       branch in exactly one remote matching the basename of `<path>,
+       base the new branch on the remote-tracking branch, and mark
+       the remote-tracking branch as "upstream" from the new branch.
++
+This can also be set up as the default behaviour by using the
+`worktree.guessRemote` config option.
+
+--[no-]track::
+       When creating a new branch, if `<commit-ish>` is a branch,
+       mark it as "upstream" from the new branch.  This is the
+       default if `<commit-ish>` is a remote-tracking branch.  See
+       "--track" in linkgit:git-branch[1] for details.
+
 --lock::
        Keep the working tree locked after creation. This is the
        equivalent of `git worktree lock` after `git worktree add`,