Add --new-branch as a long-form synonym of -b. I occasionally encounter
some confusion in new users having interpreted "checkout -b" to mean
"checkout branch", or internalized it as "the way to create a new
branch" rather than merely a convenience for "branch && checkout". I
think an explicit long-form can help alleviate that.
Signed-off-by: Mikkel Kjeldsen
---
Notes:
This makes the synopsis and description lines look a little clumsy (and
I think incorrect...?) so if this proposal is accepted perhaps those
parts are better left out. It is meant more for training and
documentation than regular usage, anyway.
I thought I had seen something like "--create-branch" in use by another
command and had intended to use that but I can no longer find that and
so went with "--new-branch" named after the option's argument.
There does not seem to be a practice for testing short- versus long-form
arguments so I did not include one, but I'd be happy to.
Documentation/git-checkout.txt | 5 +++--
builtin/checkout.c | 2 +-
t/t9902-completion.sh | 1 +
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 801de2f764..7651d8b83d 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -11,7 +11,7 @@ SYNOPSIS
'git checkout' [-q] [-f] [-m] []
'git checkout' [-q] [-f] [-m] --detach []
'git checkout' [-q] [-f] [-m] [--detach]
-'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] ] []
+'git checkout' [-q] [-f] [-m] [[(-b|--new-branch)|-B|--orphan] ]
[]
'git checkout'