@@ -18,13 +18,9 @@ SYNOPSIS
1818DESCRIPTION
1919-----------
2020Fetch branches and/or tags (collectively, "refs") from one or more
21- other repositories, along with the objects necessary to complete
22- their histories.
23-
24- The names of refs that are fetched, together with the object names
25- they point at, are written to `.git/FETCH_HEAD`. This information
26- can be used to learn what was fetched. In addition, the remote-tracking
27- branches are updated (see description on <refspec> below for details).
21+ other repositories, along with the objects necessary to complete their
22+ histories. Remote-tracking branches are updated (see the description
23+ of <refspec> below for ways to control this behavior).
2824
2925By default, any tag that points into the histories being fetched is
3026also fetched; the effect is to fetch tags that
@@ -34,14 +30,18 @@ configuring remote.<name>.tagopt. By using a refspec that fetches tags
3430explicitly, you can fetch tags that do not point into branches you
3531are interested in as well.
3632
37- 'git fetch' can fetch from either a single named repository,
33+ 'git fetch' can fetch from either a single named repository or URL ,
3834or from several repositories at once if <group> is given and
3935there is a remotes.<group> entry in the configuration file.
4036(See linkgit:git-config[1]).
4137
4238When no remote is specified, by default the `origin` remote will be used,
4339unless there's an upstream branch configured for the current branch.
4440
41+ The names of refs that are fetched, together with the object names
42+ they point at, are written to `.git/FETCH_HEAD`. This information
43+ may be used by scripts or other git commands, such as linkgit:git-pull[1].
44+
4545OPTIONS
4646-------
4747include::fetch-options.txt[]
@@ -78,6 +78,19 @@ the local repository by fetching from the branches (respectively)
7878The `pu` branch will be updated even if it is does not fast-forward,
7979because it is prefixed with a plus sign; `tmp` will not be.
8080
81+ * Peek at a remote's branch, without configuring the remote in your local
82+ repository:
83+ +
84+ ------------------------------------------------
85+ $ git fetch git://git.kernel.org/pub/scm/git/git.git maint
86+ $ git log FETCH_HEAD
87+ ------------------------------------------------
88+ +
89+ The first command fetches the `maint` branch from the repository at
90+ `git://git.kernel.org/pub/scm/git/git.git` and the second command uses
91+ `FETCH_HEAD` to examine the branch with linkgit:git-log[1]. The fetched
92+ objects will eventually be removed by git's built-in housekeeping (see
93+ linkgit:git-gc[1]).
8194
8295BUGS
8396----
0 commit comments