Thread-safe xmalloc and xrealloc needs a recursive mutex
[git/dscho.git] / Documentation / git-fetch.txt
blob948ea26c5a2b3825e61d0c6495d03829669a7351
1 git-fetch(1)
2 ============
4 NAME
5 ----
6 git-fetch - Download objects and refs from another repository
9 SYNOPSIS
10 --------
11 'git fetch' <options> <repository> <refspec>...
13 'git fetch' <options> <group>
15 'git fetch' --multiple <options> [<repository> | <group>]...
17 'git fetch' --all <options>
20 DESCRIPTION
21 -----------
22 Fetches named heads or tags from one or more other repositories,
23 along with the objects necessary to complete them.
25 The ref names and their object names of fetched refs are stored
26 in `.git/FETCH_HEAD`.  This information is left for a later merge
27 operation done by 'git merge'.
29 When <refspec> stores the fetched result in tracking branches,
30 the tags that point at these branches are automatically
31 followed.  This is done by first fetching from the remote using
32 the given <refspec>s, and if the repository has objects that are
33 pointed by remote tags that it does not yet have, then fetch
34 those missing tags.  If the other end has tags that point at
35 branches you are not interested in, you will not get them.
37 'git fetch' can fetch from either a single named repository, or
38 or from several repositories at once if <group> is given and
39 there is a remotes.<group> entry in the configuration file.
40 (See linkgit:git-config[1]).
42 OPTIONS
43 -------
44 include::fetch-options.txt[]
46 include::pull-fetch-param.txt[]
48 include::urls-remotes.txt[]
51 EXAMPLES
52 --------
54 * Update the remote-tracking branches:
56 ------------------------------------------------
57 $ git fetch origin
58 ------------------------------------------------
60 The above command copies all branches from the remote refs/heads/
61 namespace and stores them to the local refs/remotes/origin/ namespace,
62 unless the branch.<name>.fetch option is used to specify a non-default
63 refspec.
65 * Using refspecs explicitly:
67 ------------------------------------------------
68 $ git fetch origin +pu:pu maint:tmp
69 ------------------------------------------------
71 This updates (or creates, as necessary) branches `pu` and `tmp` in
72 the local repository by fetching from the branches (respectively)
73 `pu` and `maint` from the remote repository.
75 The `pu` branch will be updated even if it is does not fast-forward,
76 because it is prefixed with a plus sign; `tmp` will not be.
79 SEE ALSO
80 --------
81 linkgit:git-pull[1]
84 Author
85 ------
86 Written by Linus Torvalds <torvalds@osdl.org> and
87 Junio C Hamano <gitster@pobox.com>
89 Documentation
90 -------------
91 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
93 GIT
94 ---
95 Part of the linkgit:git[1] suite