aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-worktree.txt
diff options
context:
space:
mode:
authorJordan DE GEA <jordan.de-gea@grenoble-inp.org>2016-05-27 15:17:08 +0200
committerJunio C Hamano <gitster@pobox.com>2016-05-31 12:28:25 -0700
commit1a450e2fd1f82311b214851d5b097b74c8fb0ade (patch)
treef06a2ef566d95a336e854212c7ad41aed2f7912d /Documentation/git-worktree.txt
parentf3913c2d03abc660140678a9e14dac399f847647 (diff)
downloadgit-1a450e2fd1f82311b214851d5b097b74c8fb0ade.tar.gz
worktree: allow "-" short-hand for @{-1} in add command
Since `git worktree add` uses `git checkout` when `[<branch>]` is used, and `git checkout -` is already supported, it makes sense to allow the same shortcut in `git worktree add`. Signed-off-by: Jordan DE GEA <jordan.de-gea@grenoble-inp.org> Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-worktree.txt')
-rw-r--r--Documentation/git-worktree.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
index c62234538b..23d8d2ace0 100644
--- a/Documentation/git-worktree.txt
+++ b/Documentation/git-worktree.txt
@@ -48,7 +48,8 @@ add <path> [<branch>]::
Create `<path>` and checkout `<branch>` 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 `<branch>`; it is synonymous with `@{-1}`.
+
If `<branch>` is omitted and neither `-b` nor `-B` nor `--detached` used,
then, as a convenience, a new branch based at HEAD is created automatically,