summaryrefslogtreecommitdiffstats
path: root/git-worktree.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-23 16:07:42 +0900
committerJunio C Hamano <gitster@pobox.com>2018-05-23 16:07:42 +0900
commitb9d9d90d180cf21baeeb16bd89828d25c7901470 (patch)
treea40241052af8d4f5543b66581e3f0235cfae0af3 /git-worktree.txt
parentccb8252b46bfba5daf0cfcedaf0f9d2e14ba356f (diff)
downloadgit-htmldocs-b9d9d90d180cf21baeeb16bd89828d25c7901470.tar.gz
Autogenerated HTML docs for v2.17.0-775-ge144d
Diffstat (limited to 'git-worktree.txt')
-rw-r--r--git-worktree.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/git-worktree.txt b/git-worktree.txt
index 9920d9c06..afc6576a1 100644
--- a/git-worktree.txt
+++ b/git-worktree.txt
@@ -61,8 +61,13 @@ $ 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.
+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::