Skip to content

Commit 572fc81

Browse files
jaysoffiangitster
authored andcommitted
doc: documentation update for the branch track changes
Documents the branch.autosetupmerge=always setting and usage of --track when branching from a local branch. Signed-off-by: Jay Soffian <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9ed36cf commit 572fc81

File tree

3 files changed

+34
-32
lines changed

3 files changed

+34
-32
lines changed

Documentation/config.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,14 @@ apply.whitespace::
330330

331331
branch.autosetupmerge::
332332
Tells `git-branch` and `git-checkout` to setup new branches
333-
so that linkgit:git-pull[1] will appropriately merge from that
334-
remote branch. Note that even if this option is not set,
333+
so that linkgit:git-pull[1] will appropriately merge from the
334+
starting point branch. Note that even if this option is not set,
335335
this behavior can be chosen per-branch using the `--track`
336-
and `--no-track` options. This option defaults to false.
336+
and `--no-track` options. The valid settings are: `false` -- no
337+
automatic setup is done; `true` -- automatic setup is done when the
338+
starting point is a remote branch; `always` -- automatic setup is
339+
done when the starting point is either a local branch or remote
340+
branch. This option defaults to true.
337341

338342
branch.<name>.remote::
339343
When in branch <name>, it tells `git fetch` which remote to fetch.

Documentation/git-branch.txt

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ Note that this will create the new branch, but it will not switch the
3434
working tree to it; use "git checkout <newbranch>" to switch to the
3535
new branch.
3636

37-
When a local branch is started off a remote branch, git can setup the
38-
branch so that linkgit:git-pull[1] will appropriately merge from that
39-
remote branch. If this behavior is desired, it is possible to make it
40-
the default using the global `branch.autosetupmerge` configuration
41-
flag. Otherwise, it can be chosen per-branch using the `--track`
42-
and `--no-track` options.
37+
When a local branch is started off a remote branch, git sets up the
38+
branch so that linkgit:git-pull[1] will appropriately merge from
39+
the remote branch. This behavior may be changed via the global
40+
`branch.autosetupmerge` configuration flag. That setting can be
41+
overridden by using the `--track` and `--no-track` options.
4342

4443
With a '-m' or '-M' option, <oldbranch> will be renamed to <newbranch>.
4544
If <oldbranch> had a corresponding reflog, it is renamed to match
@@ -105,19 +104,19 @@ OPTIONS
105104
Display the full sha1s in output listing rather than abbreviating them.
106105

107106
--track::
108-
Set up configuration so that git-pull will automatically
109-
retrieve data from the remote branch. Use this if you always
110-
pull from the same remote branch into the new branch, or if you
111-
don't want to use "git pull <repository> <refspec>" explicitly. Set the
112-
branch.autosetupmerge configuration variable to true if you
113-
want git-checkout and git-branch to always behave as if
114-
'--track' were given.
107+
When creating a new branch, set up configuration so that git-pull
108+
will automatically retrieve data from the start point, which must be
109+
a branch. Use this if you always pull from the same upstream branch
110+
into the new branch, and if you don't want to use "git pull
111+
<repository> <refspec>" explicitly. This behavior is the default
112+
when the start point is a remote branch. Set the
113+
branch.autosetupmerge configuration variable to `false` if you want
114+
git-checkout and git-branch to always behave as if '--no-track' were
115+
given. Set it to `always` if you want this behavior when the
116+
start-point is either a local or remote branch.
115117

116118
--no-track::
117-
When a branch is created off a remote branch,
118-
set up configuration so that git-pull will not retrieve data
119-
from the remote branch, ignoring the branch.autosetupmerge
120-
configuration variable.
119+
Ignore the branch.autosetupmerge configuration variable.
121120

122121
<branchname>::
123122
The name of the branch to create or delete.

Documentation/git-checkout.txt

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,19 @@ OPTIONS
4848
may restrict the characters allowed in a branch name.
4949

5050
--track::
51-
When -b is given and a branch is created off a remote branch,
52-
set up configuration so that git-pull will automatically
53-
retrieve data from the remote branch. Use this if you always
54-
pull from the same remote branch into the new branch, or if you
55-
don't want to use "git pull <repository> <refspec>" explicitly. Set the
56-
branch.autosetupmerge configuration variable to true if you
57-
want git-checkout and git-branch to always behave as if
58-
'--track' were given.
51+
When creating a new branch, set up configuration so that git-pull
52+
will automatically retrieve data from the start point, which must be
53+
a branch. Use this if you always pull from the same upstream branch
54+
into the new branch, and if you don't want to use "git pull
55+
<repository> <refspec>" explicitly. This behavior is the default
56+
when the start point is a remote branch. Set the
57+
branch.autosetupmerge configuration variable to `false` if you want
58+
git-checkout and git-branch to always behave as if '--no-track' were
59+
given. Set it to `always` if you want this behavior when the
60+
start-point is either a local or remote branch.
5961

6062
--no-track::
61-
When -b is given and a branch is created off a remote branch,
62-
set up configuration so that git-pull will not retrieve data
63-
from the remote branch, ignoring the branch.autosetupmerge
64-
configuration variable.
63+
Ignore the branch.autosetupmerge configuration variable.
6564

6665
-l::
6766
Create the new branch's reflog. This activates recording of

0 commit comments

Comments
 (0)