Merge branch 'ja/fetch-doc' into maint
[git/dscho.git] / Documentation / git-fetch.txt
blobf2483d624ead24031ef3cf320a0c151cc6f6cb2b
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>...
14 DESCRIPTION
15 -----------
16 Fetches named heads or tags from another repository, along with
17 the objects necessary to complete them.
19 The ref names and their object names of fetched refs are stored
20 in `.git/FETCH_HEAD`.  This information is left for a later merge
21 operation done by 'git-merge'.
23 When <refspec> stores the fetched result in tracking branches,
24 the tags that point at these branches are automatically
25 followed.  This is done by first fetching from the remote using
26 the given <refspec>s, and if the repository has objects that are
27 pointed by remote tags that it does not yet have, then fetch
28 those missing tags.  If the other end has tags that point at
29 branches you are not interested in, you will not get them.
32 OPTIONS
33 -------
34 include::fetch-options.txt[]
36 include::pull-fetch-param.txt[]
38 include::urls-remotes.txt[]
41 EXAMPLES
42 --------
44 * Update the remote-tracking branches:
46 ------------------------------------------------
47 $ git fetch origin
48 ------------------------------------------------
50 The above command copies all branches from the remote refs/heads/
51 namespace and stores them to the local refs/remotes/origin/ namespace,
52 unless the branch.<name>.fetch option is used to specify a non-default
53 refspec.
55 * Using refspecs explicitly:
57 ------------------------------------------------
58 $ git fetch origin +pu:pu maint:tmp
59 ------------------------------------------------
61 This updates (or creates, as necessary) branches `pu` and `tmp` in
62 the local repository by fetching from the branches (respectively)
63 `pu` and `maint` from the remote repository.
65 The `pu` branch will be updated even if it is does not fast-forward,
66 because it is prefixed with a plus sign; `tmp` will not be.
69 SEE ALSO
70 --------
71 linkgit:git-pull[1]
74 Author
75 ------
76 Written by Linus Torvalds <torvalds@osdl.org> and
77 Junio C Hamano <gitster@pobox.com>
79 Documentation
80 -------------
81 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
83 GIT
84 ---
85 Part of the linkgit:git[1] suite