Merge branch 'ma/commit-graph-docs' into maint
[gitweb.git] / Documentation / git-worktree.txt
index 9920d9c06ed213ad12c89050742b2da949303445..29a5b7e252a378b2f992bdeeb6c26cfe6f01f6b4 100644 (file)
@@ -60,9 +60,23 @@ with a matching name, treat as equivalent to:
 $ git worktree add --track -b <branch> <path> <remote>/<branch>
 ------------
 +
+If the branch exists in multiple remotes and one of them is named by
+the `checkout.defaultRemote` configuration variable, we'll use that
+one for the purposes of disambiguation, even if the `<branch>` isn't
+unique across all remotes. Set it to
+e.g. `checkout.defaultRemote=origin` to always checkout remote
+branches from there if `<branch>` is ambiguous but exists on the
+'origin' remote. See also `checkout.defaultRemote` in
+linkgit:git-config[1].
++
 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.
+then, as a convenience, the new worktree is associated with a branch
+(call it `<branch>`) named after `$(basename <path>)`.  If `<branch>`
+doesn't exist, a new branch based on HEAD is automatically created as
+if `-b <branch>` was given.  If `<branch>` does exist, it will be
+checked out in the new worktree, if it's not checked out anywhere
+else, otherwise the command will refuse to create the worktree (unless
+`--force` is used).
 
 list::
 
@@ -159,6 +173,10 @@ This can also be set up as the default behaviour by using the
        This format will remain stable across Git versions and regardless of user
        configuration.  See below for details.
 
+-q::
+--quiet::
+       With 'add', suppress feedback messages.
+
 -v::
 --verbose::
        With `prune`, report all removals.