2005-09-08 08:26:23 +08:00
|
|
|
git-fetch(1)
|
|
|
|
============
|
2005-07-16 15:17:42 +08:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2007-01-19 07:53:37 +08:00
|
|
|
git-fetch - Download objects and refs from another repository
|
2005-07-16 15:17:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2010-04-10 10:50:19 +08:00
|
|
|
'git fetch' [<options>] [<repository> [<refspec>...]]
|
2005-07-16 15:17:42 +08:00
|
|
|
|
2010-04-10 10:50:19 +08:00
|
|
|
'git fetch' [<options>] <group>
|
2009-11-10 04:09:56 +08:00
|
|
|
|
2010-04-10 10:50:19 +08:00
|
|
|
'git fetch' --multiple [<options>] [<repository> | <group>]...
|
2009-11-10 04:10:32 +08:00
|
|
|
|
2010-04-10 10:50:19 +08:00
|
|
|
'git fetch' --all [<options>]
|
2009-11-10 04:09:56 +08:00
|
|
|
|
2005-07-16 15:17:42 +08:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2009-11-10 04:09:56 +08:00
|
|
|
Fetches named heads or tags from one or more other repositories,
|
|
|
|
along with the objects necessary to complete them.
|
2005-08-25 07:23:08 +08:00
|
|
|
|
|
|
|
The ref names and their object names of fetched refs are stored
|
2005-11-07 13:30:56 +08:00
|
|
|
in `.git/FETCH_HEAD`. This information is left for a later merge
|
2010-01-10 07:33:00 +08:00
|
|
|
operation done by 'git merge'.
|
2005-07-16 15:17:42 +08:00
|
|
|
|
2007-02-10 07:41:35 +08:00
|
|
|
When <refspec> stores the fetched result in tracking branches,
|
|
|
|
the tags that point at these branches are automatically
|
|
|
|
followed. This is done by first fetching from the remote using
|
|
|
|
the given <refspec>s, and if the repository has objects that are
|
|
|
|
pointed by remote tags that it does not yet have, then fetch
|
|
|
|
those missing tags. If the other end has tags that point at
|
|
|
|
branches you are not interested in, you will not get them.
|
|
|
|
|
2009-11-10 04:09:56 +08:00
|
|
|
'git fetch' can fetch from either a single named repository, or
|
|
|
|
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 15:17:42 +08:00
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
2005-11-07 13:30:56 +08:00
|
|
|
include::fetch-options.txt[]
|
2005-07-16 15:17:42 +08:00
|
|
|
|
2005-11-07 13:30:56 +08:00
|
|
|
include::pull-fetch-param.txt[]
|
2005-10-20 12:25:39 +08:00
|
|
|
|
2007-07-05 06:21:36 +08:00
|
|
|
include::urls-remotes.txt[]
|
2005-07-16 15:17:42 +08:00
|
|
|
|
2009-10-22 01:21:23 +08: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.
|
|
|
|
|
|
|
|
|
2005-11-05 17:37:00 +08:00
|
|
|
SEE ALSO
|
|
|
|
--------
|
2007-12-29 14:20:38 +08:00
|
|
|
linkgit:git-pull[1]
|
2005-11-05 17:37:00 +08:00
|
|
|
|
|
|
|
|
2005-07-16 15:17:42 +08:00
|
|
|
Author
|
|
|
|
------
|
2005-08-15 08:24:36 +08:00
|
|
|
Written by Linus Torvalds <torvalds@osdl.org> and
|
2008-07-22 03:14:42 +08:00
|
|
|
Junio C Hamano <gitster@pobox.com>
|
2005-07-16 15:17:42 +08:00
|
|
|
|
|
|
|
Documentation
|
2005-10-04 01:16:30 +08:00
|
|
|
-------------
|
2005-07-16 15:17:42 +08:00
|
|
|
Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
|
|
|
|
|
|
|
|
GIT
|
|
|
|
---
|
2008-06-06 15:07:32 +08:00
|
|
|
Part of the linkgit:git[1] suite
|