]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/checkout.c
branch: add flags and config to inherit tracking
[thirdparty/git.git] / builtin / checkout.c
index cbf73b8c9f65ae2fdd1d96265bd4972aeaa9bd68..8d511aa6b70635073fbd1e99c5feafb3c03e2cc8 100644 (file)
@@ -1530,8 +1530,10 @@ static struct option *add_common_switch_branch_options(
 {
        struct option options[] = {
                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_CALLBACK_F('t', "track",  &opts->track, "direct|inherit",
+                       N_("set up tracking mode (see git-pull(1))"),
+                       PARSE_OPT_OPTARG | PARSE_OPT_LITERAL_ARGHELP,
+                       parse_opt_tracking_mode),
                OPT__FORCE(&opts->force, N_("force checkout (throw away local modifications)"),
                           PARSE_OPT_NOCOMPLETE),
                OPT_STRING(0, "orphan", &opts->new_orphan_branch, N_("new-branch"), N_("new unparented branch")),