Skip to content

Commit 66a062a

Browse files
moygitster
authored andcommitted
user-manual.txt: explain better the remote(-tracking) branch terms
Now that the documentation is mostly consistant in the use of "remote branch" Vs "remote-tracking branch", let's make this distinction explicit early in the user-manual. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 1393123 commit 66a062a

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

Documentation/user-manual.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,8 @@ Examining branches from a remote repository
344344
The "master" branch that was created at the time you cloned is a copy
345345
of the HEAD in the repository that you cloned from. That repository
346346
may also have had other branches, though, and your local repository
347-
keeps branches which track each of those remote branches, which you
347+
keeps branches which track each of those remote branches, called
348+
remote-tracking branches, which you
348349
can view using the "-r" option to linkgit:git-branch[1]:
349350

350351
------------------------------------------------
@@ -359,6 +360,13 @@ $ git branch -r
359360
origin/todo
360361
------------------------------------------------
361362

363+
In this example, "origin" is called a remote repository, or "remote"
364+
for short. The branches of this repository are called "remote
365+
branches" from our point of view. The remote-tracking branches listed
366+
above were created based on the remote branches at clone time and will
367+
be updated by "git fetch" (hence "git pull") and "git push". See
368+
<<Updating-a-repository-With-git-fetch>> for details.
369+
362370
You cannot check out these remote-tracking branches, but you can
363371
examine them on a branch of your own, just as you would a tag:
364372

@@ -1716,14 +1724,19 @@ one step:
17161724
$ git pull origin master
17171725
-------------------------------------------------
17181726

1719-
In fact, if you have "master" checked out, then by default "git pull"
1720-
merges from the HEAD branch of the origin repository. So often you can
1727+
In fact, if you have "master" checked out, then this branch has been
1728+
configured by "git clone" to get changes from the HEAD branch of the
1729+
origin repository. So often you can
17211730
accomplish the above with just a simple
17221731

17231732
-------------------------------------------------
17241733
$ git pull
17251734
-------------------------------------------------
17261735

1736+
This command will fetch changes from the remote branches to your
1737+
remote-tracking branches `origin/*`, and merge the default branch into
1738+
the current branch.
1739+
17271740
More generally, a branch that is created from a remote-tracking branch
17281741
will pull
17291742
by default from that branch. See the descriptions of the

0 commit comments

Comments
 (0)