diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-01-31 10:37:44 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-31 10:37:44 -0800 |
commit | 09e0be130d83ceedb3653d9a41768c6a13457ac5 (patch) | |
tree | 466600cb071233316506ff31a3e9966679fb2908 /Documentation | |
parent | The first batch to start the current cycle (diff) | |
parent | branch,checkout: fix --track documentation (diff) | |
download | tgif-09e0be130d83ceedb3653d9a41768c6a13457ac5.tar.xz |
Merge branch 'js/branch-track-inherit' into gc/branch-recurse-submodules
* js/branch-track-inherit:
branch,checkout: fix --track documentation
branch,checkout: fix --track usage strings
config: require lowercase for branch.*.autosetupmerge
branch: add flags and config to inherit tracking
branch: accept multiple upstream branches for tracking
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/config/branch.txt | 3 | ||||
-rw-r--r-- | Documentation/git-branch.txt | 24 | ||||
-rw-r--r-- | Documentation/git-checkout.txt | 2 | ||||
-rw-r--r-- | Documentation/git-switch.txt | 2 |
4 files changed, 21 insertions, 10 deletions
diff --git a/Documentation/config/branch.txt b/Documentation/config/branch.txt index d323d7327f..1e0c7af014 100644 --- a/Documentation/config/branch.txt +++ b/Documentation/config/branch.txt @@ -7,7 +7,8 @@ branch.autoSetupMerge:: automatic setup is done; `true` -- automatic setup is done when the starting point is a remote-tracking branch; `always` -- automatic setup is done when the starting point is either a - local branch or remote-tracking + local branch or remote-tracking branch; `inherit` -- if the starting point + has a tracking configuration, it is copied to the new branch. This option defaults to true. branch.autoSetupRebase:: diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index 8af42eff89..731e340cbc 100644 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@ -16,7 +16,7 @@ SYNOPSIS [--points-at <object>] [--format=<format>] [(-r | --remotes) | (-a | --all)] [--list] [<pattern>...] -'git branch' [--track | --no-track] [-f] <branchname> [<start-point>] +'git branch' [--track[=(direct|inherit)] | --no-track] [-f] <branchname> [<start-point>] 'git branch' (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>] 'git branch' --unset-upstream [<branchname>] 'git branch' (-m | -M) [<oldbranch>] <newbranch> @@ -206,24 +206,34 @@ This option is only applicable in non-verbose mode. Display the full sha1s in the output listing rather than abbreviating them. -t:: ---track:: +--track[=(direct|inherit)]:: When creating a new branch, set up `branch.<name>.remote` and - `branch.<name>.merge` configuration entries to mark the - start-point branch as "upstream" from the new branch. This + `branch.<name>.merge` configuration entries to set "upstream" tracking + configuration for the new branch. This configuration will tell git to show the relationship between the two branches in `git status` and `git branch -v`. Furthermore, it directs `git pull` without arguments to pull from the upstream when the new branch is checked out. + -This behavior is the default when the start point is a remote-tracking branch. +The exact upstream branch is chosen depending on the optional argument: +`-t`, `--track`, or `--track=direct` means to use the start-point branch +itself as the upstream; `--track=inherit` means to copy the upstream +configuration of the start-point branch. ++ +`--track=direct` is the default when the start point is a remote-tracking branch. Set the branch.autoSetupMerge configuration variable to `false` if you want `git switch`, `git checkout` and `git branch` to always behave as if `--no-track` were given. Set it to `always` if you want this behavior when the -start-point is either a local or remote-tracking branch. +start-point is either a local or remote-tracking branch. Set it to +`inherit` if you want to copy the tracking configuration from the +branch point. ++ +See linkgit:git-pull[1] and linkgit:git-config[1] for additional discussion on +how the `branch.<name>.remote` and `branch.<name>.merge` options are used. --no-track:: Do not set up "upstream" configuration, even if the - branch.autoSetupMerge configuration variable is true. + branch.autoSetupMerge configuration variable is set. --set-upstream:: As this option had confusing syntax, it is no longer supported. diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index d473c9bf38..4353f1031b 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -156,7 +156,7 @@ of it"). linkgit:git-branch[1] for details. -t:: ---track:: +--track[=(direct|inherit)]:: When creating a new branch, set up "upstream" configuration. See "--track" in linkgit:git-branch[1] for details. + diff --git a/Documentation/git-switch.txt b/Documentation/git-switch.txt index 5c438cd505..96dc036ea5 100644 --- a/Documentation/git-switch.txt +++ b/Documentation/git-switch.txt @@ -152,7 +152,7 @@ should result in deletion of the path). attached to a terminal, regardless of `--quiet`. -t:: ---track:: +--track [direct|inherit]:: When creating a new branch, set up "upstream" configuration. `-c` is implied. See `--track` in linkgit:git-branch[1] for details. |