Skip to content

Commit 297ca89

Browse files
committed
Merge branch 'js/branch-track-inherit'
"git branch -h" incorrectly said "--track[=direct|inherit]", implying that "--trackinherit" is a valid option, which has been corrected. source: <3de40324bea6a1dd9bca2654721471e3809e87d8.1642538935.git.steadmon@google.com> source: <[email protected]> * js/branch-track-inherit: branch,checkout: fix --track documentation
2 parents 50b2d72 + 6327f0e commit 297ca89

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Documentation/git-branch.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ SYNOPSIS
1616
[--points-at <object>] [--format=<format>]
1717
[(-r | --remotes) | (-a | --all)]
1818
[--list] [<pattern>...]
19-
'git branch' [--track [direct|inherit] | --no-track] [-f] <branchname> [<start-point>]
19+
'git branch' [--track[=(direct|inherit)] | --no-track] [-f] <branchname> [<start-point>]
2020
'git branch' (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>]
2121
'git branch' --unset-upstream [<branchname>]
2222
'git branch' (-m | -M) [<oldbranch>] <newbranch>
@@ -206,7 +206,7 @@ This option is only applicable in non-verbose mode.
206206
Display the full sha1s in the output listing rather than abbreviating them.
207207

208208
-t::
209-
--track [inherit|direct]::
209+
--track[=(direct|inherit)]::
210210
When creating a new branch, set up `branch.<name>.remote` and
211211
`branch.<name>.merge` configuration entries to set "upstream" tracking
212212
configuration for the new branch. This
@@ -216,11 +216,11 @@ This option is only applicable in non-verbose mode.
216216
upstream when the new branch is checked out.
217217
+
218218
The exact upstream branch is chosen depending on the optional argument:
219-
`--track` or `--track direct` means to use the start-point branch itself as the
220-
upstream; `--track inherit` means to copy the upstream configuration of the
221-
start-point branch.
219+
`-t`, `--track`, or `--track=direct` means to use the start-point branch
220+
itself as the upstream; `--track=inherit` means to copy the upstream
221+
configuration of the start-point branch.
222222
+
223-
`--track direct` is the default when the start point is a remote-tracking branch.
223+
`--track=direct` is the default when the start point is a remote-tracking branch.
224224
Set the branch.autoSetupMerge configuration variable to `false` if you
225225
want `git switch`, `git checkout` and `git branch` to always behave as if `--no-track`
226226
were given. Set it to `always` if you want this behavior when the

Documentation/git-checkout.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ of it").
156156
linkgit:git-branch[1] for details.
157157

158158
-t::
159-
--track [direct|inherit]::
159+
--track[=(direct|inherit)]::
160160
When creating a new branch, set up "upstream" configuration. See
161161
"--track" in linkgit:git-branch[1] for details.
162162
+

builtin/branch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
638638
OPT__VERBOSE(&filter.verbose,
639639
N_("show hash and subject, give twice for upstream branch")),
640640
OPT__QUIET(&quiet, N_("suppress informational messages")),
641-
OPT_CALLBACK_F('t', "track", &track, N_("mode"),
641+
OPT_CALLBACK_F('t', "track", &track, "(direct|inherit)",
642642
N_("set branch tracking configuration"),
643643
PARSE_OPT_OPTARG,
644644
parse_opt_tracking_mode),

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,7 @@ static struct option *add_common_switch_branch_options(
15491549
{
15501550
struct option options[] = {
15511551
OPT_BOOL('d', "detach", &opts->force_detach, N_("detach HEAD at named commit")),
1552-
OPT_CALLBACK_F('t', "track", &opts->track, N_("mode"),
1552+
OPT_CALLBACK_F('t', "track", &opts->track, "(direct|inherit)",
15531553
N_("set branch tracking configuration"),
15541554
PARSE_OPT_OPTARG,
15551555
parse_opt_tracking_mode),

0 commit comments

Comments
 (0)