diff options
| author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2019-03-29 17:39:12 +0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-04-02 13:57:00 +0900 |
| commit | 163e3b2975cf07e72c81df4bcdf3d74ae667f4d8 (patch) | |
| tree | 8a9ba4f21d553574058a94e47ec62d7a5d397eb1 | |
| parent | 7968bef06b750fe9c59c1e1d0573bffc5b3cd94f (diff) | |
| download | git-163e3b2975cf07e72c81df4bcdf3d74ae667f4d8.tar.xz | |
switch: add short option for --detach
"git checkout" automatically detaches branches and --detach is not
that useful (--no-detach is more likely). But for "switch", you
may want to use it more often once you're used to detached HEAD. This
of course adds -d to git-checkout but it does not harm (yet?) to do it.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| -rw-r--r-- | builtin/checkout.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index 4416b82bfd..11308ab80c 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1423,7 +1423,7 @@ static struct option *add_common_switch_branch_options( struct checkout_opts *opts, struct option *prevopts) { struct option options[] = { - OPT_BOOL(0, "detach", &opts->force_detach, N_("detach HEAD at named commit")), + OPT_BOOL('d', "detach", &opts->force_detach, N_("detach HEAD at named commit")), OPT_SET_INT('t', "track", &opts->track, N_("set upstream info for new branch"), BRANCH_TRACK_EXPLICIT), OPT_STRING(0, "orphan", &opts->new_orphan_branch, N_("new-branch"), N_("new unparented branch")), |
