unpack-trees: oneway_merge to update submodules
[gitweb.git] / Documentation / git-worktree.txt
index 15e58b18f78a7ae3f020ed38961580959bdba58b..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,16 @@ 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