2005-09-08 02:26:23 +02:00
|
|
|
git-fetch(1)
|
|
|
|
============
|
2005-07-16 09:17:42 +02:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2007-01-19 00:53:37 +01:00
|
|
|
git-fetch - Download objects and refs from another repository
|
2005-07-16 09:17:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2011-07-02 04:38:26 +02:00
|
|
|
[verse]
|
2010-04-10 04:50:19 +02:00
|
|
|
'git fetch' [<options>] [<repository> [<refspec>...]]
|
|
|
|
'git fetch' [<options>] <group>
|
2010-10-08 19:31:17 +02:00
|
|
|
'git fetch' --multiple [<options>] [(<repository> | <group>)...]
|
2010-04-10 04:50:19 +02:00
|
|
|
'git fetch' --all [<options>]
|
2009-11-09 21:09:56 +01:00
|
|
|
|
2005-07-16 09:17:42 +02:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2009-11-09 21:09:56 +01:00
|
|
|
Fetches named heads or tags from one or more other repositories,
|
|
|
|
along with the objects necessary to complete them.
|
2005-08-25 01:23:08 +02:00
|
|
|
|
|
|
|
The ref names and their object names of fetched refs are stored
|
2005-11-07 06:30:56 +01:00
|
|
|
in `.git/FETCH_HEAD`. This information is left for a later merge
|
2010-01-10 00:33:00 +01:00
|
|
|
operation done by 'git merge'.
|
2005-07-16 09:17:42 +02:00
|
|
|
|
2013-10-30 06:33:06 +01:00
|
|
|
By default, tags are auto-followed. This means that when fetching
|
|
|
|
from a remote, any tags on the remote that point to objects that exist
|
|
|
|
in the local repository are fetched. The effect is to fetch tags that
|
|
|
|
point at branches that you are interested in. This default behavior
|
|
|
|
can be changed by using the --tags or --no-tags options, by
|
|
|
|
configuring remote.<name>.tagopt, or by using a refspec that fetches
|
|
|
|
tags explicitly.
|
2007-02-10 00:41:35 +01:00
|
|
|
|
2011-04-13 17:39:40 +02:00
|
|
|
'git fetch' can fetch from either a single named repository,
|
2009-11-09 21:09:56 +01:00
|
|
|
or from several repositories at once if <group> is given and
|
|
|
|
there is a remotes.<group> entry in the configuration file.
|
|
|
|
(See linkgit:git-config[1]).
|
2005-07-16 09:17:42 +02:00
|
|
|
|
2013-12-08 06:56:58 +01:00
|
|
|
When no remote is specified, by default the `origin` remote will be used,
|
|
|
|
unless there's an upstream branch configured for the current branch.
|
|
|
|
|
2005-07-16 09:17:42 +02:00
|
|
|
OPTIONS
|
|
|
|
-------
|
2005-11-07 06:30:56 +01:00
|
|
|
include::fetch-options.txt[]
|
2005-07-16 09:17:42 +02:00
|
|
|
|
2005-11-07 06:30:56 +01:00
|
|
|
include::pull-fetch-param.txt[]
|
2005-10-20 06:25:39 +02:00
|
|
|
|
2007-07-05 00:21:36 +02:00
|
|
|
include::urls-remotes.txt[]
|
2005-07-16 09:17:42 +02:00
|
|
|
|
2009-10-21 19:21:23 +02:00
|
|
|
|
|
|
|
EXAMPLES
|
|
|
|
--------
|
|
|
|
|
|
|
|
* Update the remote-tracking branches:
|
|
|
|
+
|
|
|
|
------------------------------------------------
|
|
|
|
$ git fetch origin
|
|
|
|
------------------------------------------------
|
|
|
|
+
|
|
|
|
The above command copies all branches from the remote refs/heads/
|
|
|
|
namespace and stores them to the local refs/remotes/origin/ namespace,
|
|
|
|
unless the branch.<name>.fetch option is used to specify a non-default
|
|
|
|
refspec.
|
|
|
|
|
|
|
|
* Using refspecs explicitly:
|
|
|
|
+
|
|
|
|
------------------------------------------------
|
|
|
|
$ git fetch origin +pu:pu maint:tmp
|
|
|
|
------------------------------------------------
|
|
|
|
+
|
|
|
|
This updates (or creates, as necessary) branches `pu` and `tmp` in
|
|
|
|
the local repository by fetching from the branches (respectively)
|
|
|
|
`pu` and `maint` from the remote repository.
|
|
|
|
+
|
|
|
|
The `pu` branch will be updated even if it is does not fast-forward,
|
|
|
|
because it is prefixed with a plus sign; `tmp` will not be.
|
|
|
|
|
|
|
|
|
2011-03-06 23:14:15 +01:00
|
|
|
BUGS
|
|
|
|
----
|
|
|
|
Using --recurse-submodules can only fetch new commits in already checked
|
|
|
|
out submodules right now. When e.g. upstream added a new submodule in the
|
|
|
|
just fetched commits of the superproject the submodule itself can not be
|
|
|
|
fetched, making it impossible to check out that submodule later without
|
2013-01-21 20:17:53 +01:00
|
|
|
having to do a fetch again. This is expected to be fixed in a future Git
|
2011-03-06 23:14:15 +01:00
|
|
|
version.
|
|
|
|
|
2005-11-05 10:37:00 +01:00
|
|
|
SEE ALSO
|
|
|
|
--------
|
2007-12-29 07:20:38 +01:00
|
|
|
linkgit:git-pull[1]
|
2005-11-05 10:37:00 +01:00
|
|
|
|
2005-07-16 09:17:42 +02:00
|
|
|
GIT
|
|
|
|
---
|
2008-06-06 09:07:32 +02:00
|
|
|
Part of the linkgit:git[1] suite
|