Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2015-07-06 20:30:58 +0300
committerJunio C Hamano <gitster@pobox.com>2015-07-06 21:07:48 +0300
commit0f4af3b9ea1fc62e445271bb2e7fbb8e1ac230b7 (patch)
tree0980a1eeee8eababf711fc6b2e1dc0133bc0adac /Documentation/git-worktree.txt
parentf5682b2a861cbde6e9aca324caa5e2d36c49569a (diff)
worktree: add: make -b/-B default to HEAD when <branch> is omitted
As a convenience, like "git branch" and "git checkout -b", make "git worktree add -b <newbranch> <path> <branch>" default to HEAD when <branch> is omitted. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-worktree.txt')
-rw-r--r--Documentation/git-worktree.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
index f44cd78784..377ae0f92e 100644
--- a/Documentation/git-worktree.txt
+++ b/Documentation/git-worktree.txt
@@ -68,6 +68,7 @@ OPTIONS
-B <new-branch>::
With `add`, create a new branch named `<new-branch>` starting at
`<branch>`, and check out `<new-branch>` into the new worktree.
+ If `<branch>` is omitted, it defaults to HEAD.
By default, `-b` refuses to create a new branch if it already
exists. `-B` overrides this safeguard, resetting `<new-branch>` to
`<branch>`.