@@ -18,13 +18,9 @@ SYNOPSIS
18
18
DESCRIPTION
19
19
-----------
20
20
Fetch 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).
28
24
29
25
By default, any tag that points into the histories being fetched is
30
26
also fetched; the effect is to fetch tags that
@@ -34,14 +30,18 @@ configuring remote.<name>.tagopt. By using a refspec that fetches tags
34
30
explicitly, you can fetch tags that do not point into branches you
35
31
are interested in as well.
36
32
37
- 'git fetch' can fetch from either a single named repository,
33
+ 'git fetch' can fetch from either a single named repository or URL ,
38
34
or from several repositories at once if <group> is given and
39
35
there is a remotes.<group> entry in the configuration file.
40
36
(See linkgit:git-config[1]).
41
37
42
38
When no remote is specified, by default the `origin` remote will be used,
43
39
unless there's an upstream branch configured for the current branch.
44
40
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
+
45
45
OPTIONS
46
46
-------
47
47
include::fetch-options.txt[]
@@ -78,6 +78,19 @@ the local repository by fetching from the branches (respectively)
78
78
The `pu` branch will be updated even if it is does not fast-forward,
79
79
because it is prefixed with a plus sign; `tmp` will not be.
80
80
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]).
81
94
82
95
BUGS
83
96
----
0 commit comments