fetch: add missing documentation
[git/mingw.git] / Documentation / git-fetch.txt
bloba7b245d946160ab351d7a01792eac653f78643a5
1 git-fetch(1)
2 ============
4 NAME
5 ----
6 git-fetch - Download objects and refs from another repository
9 SYNOPSIS
10 --------
11 [verse]
12 'git fetch' [<options>] [<repository> [<refspec>...]]
13 'git fetch' [<options>] <group>
14 'git fetch' --multiple [<options>] [(<repository> | <group>)...]
15 'git fetch' --all [<options>]
18 DESCRIPTION
19 -----------
20 Fetches named heads or tags from one or more other repositories,
21 along with the objects necessary to complete them.
23 The ref names and their object names of fetched refs are stored
24 in `.git/FETCH_HEAD`.  This information is left for a later merge
25 operation done by 'git merge'.
27 When <refspec> stores the fetched result in remote-tracking branches,
28 the tags that point at these branches are automatically
29 followed.  This is done by first fetching from the remote using
30 the given <refspec>s, and if the repository has objects that are
31 pointed by remote tags that it does not yet have, then fetch
32 those missing tags.  If the other end has tags that point at
33 branches you are not interested in, you will not get them.
35 'git fetch' can fetch from either a single named repository,
36 or from several repositories at once if <group> is given and
37 there is a remotes.<group> entry in the configuration file.
38 (See linkgit:git-config[1]).
40 When no remote is specified, by default the `origin` remote will be used,
41 unless there's an upstream branch configured for the current branch.
43 OPTIONS
44 -------
45 include::fetch-options.txt[]
47 include::pull-fetch-param.txt[]
49 include::urls-remotes.txt[]
52 EXAMPLES
53 --------
55 * Update the remote-tracking branches:
57 ------------------------------------------------
58 $ git fetch origin
59 ------------------------------------------------
61 The above command copies all branches from the remote refs/heads/
62 namespace and stores them to the local refs/remotes/origin/ namespace,
63 unless the branch.<name>.fetch option is used to specify a non-default
64 refspec.
66 * Using refspecs explicitly:
68 ------------------------------------------------
69 $ git fetch origin +pu:pu maint:tmp
70 ------------------------------------------------
72 This updates (or creates, as necessary) branches `pu` and `tmp` in
73 the local repository by fetching from the branches (respectively)
74 `pu` and `maint` from the remote repository.
76 The `pu` branch will be updated even if it is does not fast-forward,
77 because it is prefixed with a plus sign; `tmp` will not be.
80 BUGS
81 ----
82 Using --recurse-submodules can only fetch new commits in already checked
83 out submodules right now. When e.g. upstream added a new submodule in the
84 just fetched commits of the superproject the submodule itself can not be
85 fetched, making it impossible to check out that submodule later without
86 having to do a fetch again. This is expected to be fixed in a future Git
87 version.
89 SEE ALSO
90 --------
91 linkgit:git-pull[1]
93 GIT
94 ---
95 Part of the linkgit:git[1] suite