git p4 test: is_cli_file_writeable succeeds
[git.git] / Documentation / git-fetch.txt
blob10657134a80bd2cc013c34efeba0645ede368c64
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 By default, tags are auto-followed.  This means that when fetching
28 from a remote, any tags on the remote that point to objects that exist
29 in the local repository are fetched.  The effect is to fetch tags that
30 point at branches that you are interested in.  This default behavior
31 can be changed by using the --tags or --no-tags options, by
32 configuring remote.<name>.tagopt, or by using a refspec that fetches
33 tags explicitly.
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 OPTIONS
41 -------
42 include::fetch-options.txt[]
44 include::pull-fetch-param.txt[]
46 include::urls-remotes.txt[]
49 EXAMPLES
50 --------
52 * Update the remote-tracking branches:
54 ------------------------------------------------
55 $ git fetch origin
56 ------------------------------------------------
58 The above command copies all branches from the remote refs/heads/
59 namespace and stores them to the local refs/remotes/origin/ namespace,
60 unless the branch.<name>.fetch option is used to specify a non-default
61 refspec.
63 * Using refspecs explicitly:
65 ------------------------------------------------
66 $ git fetch origin +pu:pu maint:tmp
67 ------------------------------------------------
69 This updates (or creates, as necessary) branches `pu` and `tmp` in
70 the local repository by fetching from the branches (respectively)
71 `pu` and `maint` from the remote repository.
73 The `pu` branch will be updated even if it is does not fast-forward,
74 because it is prefixed with a plus sign; `tmp` will not be.
77 BUGS
78 ----
79 Using --recurse-submodules can only fetch new commits in already checked
80 out submodules right now. When e.g. upstream added a new submodule in the
81 just fetched commits of the superproject the submodule itself can not be
82 fetched, making it impossible to check out that submodule later without
83 having to do a fetch again. This is expected to be fixed in a future Git
84 version.
86 SEE ALSO
87 --------
88 linkgit:git-pull[1]
90 GIT
91 ---
92 Part of the linkgit:git[1] suite