Eric Sunshine <sunsh...@sunshineco.com> writes:

> 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 <sunsh...@sunshineco.com>
> ---
>  Documentation/git-worktree.txt | 1 +
>  builtin/worktree.c             | 6 ++++--
>  t/t2025-worktree-add.sh        | 7 +++++++
>  3 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
> index f6c3747..5ca11f6 100644
> --- a/Documentation/git-worktree.txt
> +++ b/Documentation/git-worktree.txt
> @@ -69,6 +69,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.

What would be the SYNOPSIS change to adjust for this, I wonder.

'git worktree add' [-f] [--detach] [-b <new-branch>] <path> [<branch>]

or something?  Can I omit <branch> without giving -b <new-branch>?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to