Skip to content

Commit 163e3b2

Browse files
pcloudsgitster
authored andcommitted
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>
1 parent 7968bef commit 163e3b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ static struct option *add_common_switch_branch_options(
14231423
struct checkout_opts *opts, struct option *prevopts)
14241424
{
14251425
struct option options[] = {
1426-
OPT_BOOL(0, "detach", &opts->force_detach, N_("detach HEAD at named commit")),
1426+
OPT_BOOL('d', "detach", &opts->force_detach, N_("detach HEAD at named commit")),
14271427
OPT_SET_INT('t', "track", &opts->track, N_("set upstream info for new branch"),
14281428
BRANCH_TRACK_EXPLICIT),
14291429
OPT_STRING(0, "orphan", &opts->new_orphan_branch, N_("new-branch"), N_("new unparented branch")),

0 commit comments

Comments
 (0)