blob: b3467664d30bde111af06ec0e915e6def2b1b4b2 [file] [log] [blame]
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -07001git-fetch-pack(1)
2=================
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -07003
4NAME
5----
Fredrik Kuivinen7bd7f282006-03-09 17:24:50 +01006git-fetch-pack - Receive missing objects from another repository
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -07007
8
9SYNOPSIS
10--------
Martin von Zweigbergk7791a1d2011-07-01 22:38:26 -040011[verse]
Thomas Ackermanncc91a852012-10-16 19:20:10 +020012'git fetch-pack' [--all] [--quiet|-q] [--keep|-k] [--thin] [--include-tag]
Felipe Contreras0460ed22013-05-08 20:16:55 -050013 [--upload-pack=<git-upload-pack>]
14 [--depth=<n>] [--no-progress]
Torsten Bögershausen70cce992013-11-08 18:54:05 +010015 [-v] <repository> [<refs>...]
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -070016
17DESCRIPTION
18-----------
Thomas Rast0b444cd2010-01-10 00:33:00 +010019Usually you would want to use 'git fetch', which is a
Jonathan Nieder483bc4f2008-06-30 13:56:34 -050020higher level wrapper of this command, instead.
Junio C Hamano5cb545f2007-01-17 13:03:29 -080021
Jonathan Niederba020ef2008-07-03 00:41:41 -050022Invokes 'git-upload-pack' on a possibly remote repository
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -070023and asks it to send objects missing from this repository, to
24update the named heads. The list of commits available locally
Jeff Kingcc1b8d82010-02-17 20:16:20 -050025is found out by scanning the local refs/ hierarchy and sent to
Jonathan Niederba020ef2008-07-03 00:41:41 -050026'git-upload-pack' running on the other end.
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -070027
Junio C Hamano33b83032005-08-12 02:08:29 -070028This command degenerates to download everything to complete the
29asked refs from the remote side when the local side does not
30have a common ancestor commit.
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -070031
32
33OPTIONS
34-------
Stephan Beyer32402402008-06-08 03:36:09 +020035--all::
Uwe Kleine-König18bd8822007-01-19 13:43:00 +010036 Fetch all remote refs.
37
Ivan Todoroski078b8952012-04-02 17:13:48 +020038--stdin::
39 Take the list of refs from stdin, one per line. If there
40 are refs specified on the command line in addition to this
41 option, then the refs from stdin are processed after those
42 on the command line.
43+
Matthieu Moybcf96262016-06-28 13:40:11 +020044If `--stateless-rpc` is specified together with this option then
Ivan Todoroski078b8952012-04-02 17:13:48 +020045the list of refs must be in packet format (pkt-line). Each ref must
46be in a separate packet, and the list must end with a flush packet.
47
Stephan Beyer32402402008-06-08 03:36:09 +020048-q::
49--quiet::
Matthieu Moy23f82392016-06-28 13:40:10 +020050 Pass `-q` flag to 'git unpack-objects'; this makes the
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -070051 cloning process less verbose.
52
Stephan Beyer32402402008-06-08 03:36:09 +020053-k::
54--keep::
Thomas Rast0b444cd2010-01-10 00:33:00 +010055 Do not invoke 'git unpack-objects' on received data, but
Junio C Hamanoad897212005-12-14 22:17:38 -080056 create a single packfile out of it instead, and store it
Nicolas Pitreda093d32006-11-01 17:06:23 -050057 in the object database. If provided twice then the pack is
58 locked against repacking.
Junio C Hamanoad897212005-12-14 22:17:38 -080059
Stephan Beyer32402402008-06-08 03:36:09 +020060--thin::
Stephen Boyd738820a2010-02-18 01:10:28 -080061 Fetch a "thin" pack, which records objects in deltified form based
62 on objects not included in the pack to reduce network traffic.
Uwe Kleine-König18bd8822007-01-19 13:43:00 +010063
Stephan Beyer32402402008-06-08 03:36:09 +020064--include-tag::
Shawn O. Pearce348e3902008-03-03 22:27:33 -050065 If the remote side supports it, annotated tags objects will
66 be downloaded on the same connection as the other objects if
67 the object the tag references is downloaded. The caller must
68 otherwise determine the tags this option made available.
69
Stephan Beyer32402402008-06-08 03:36:09 +020070--upload-pack=<git-upload-pack>::
Jonathan Niederba020ef2008-07-03 00:41:41 -050071 Use this to specify the path to 'git-upload-pack' on the
Elijah Newren89363522023-10-08 06:45:07 +000072 remote side, if it is not found on your $PATH.
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -070073 Installations of sshd ignores the user's environment
74 setup scripts for login shells (e.g. .bash_profile) and
Christian Meder72e93402005-10-10 16:01:31 -070075 your privately installed git may not be found on the system
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -070076 default $PATH. Another workaround suggested is to set
77 up your $PATH in ".bashrc", but this flag is for people
78 who do not want to pay the overhead for non-interactive
79 shells by having a lean .bashrc file (they set most of
80 the things up in .bash_profile).
81
Stephan Beyer32402402008-06-08 03:36:09 +020082--exec=<git-upload-pack>::
Jeff King1c262bb2015-05-13 01:01:38 -040083 Same as --upload-pack=<git-upload-pack>.
Uwe Kleine-König27dca072007-01-23 09:20:17 +010084
Stephan Beyer32402402008-06-08 03:36:09 +020085--depth=<n>::
Uwe Kleine-König18bd8822007-01-19 13:43:00 +010086 Limit fetching to ancestor-chains not longer than n.
Nguyễn Thái Ngọc Duy4dcb1672013-01-11 16:05:46 +070087 'git-upload-pack' treats the special depth 2147483647 as
88 infinite even if there is an ancestor-chain that long.
Uwe Kleine-König18bd8822007-01-19 13:43:00 +010089
Nguyễn Thái Ngọc Duy508ea882016-06-12 17:53:59 +070090--shallow-since=<date>::
Elijah Newrenc30d4f12018-04-05 10:20:26 -070091 Deepen or shorten the history of a shallow repository to
Nguyễn Thái Ngọc Duy508ea882016-06-12 17:53:59 +070092 include all reachable commits after <date>.
93
Nguyễn Thái Ngọc Duya45a2602016-06-12 17:54:04 +070094--shallow-exclude=<revision>::
95 Deepen or shorten the history of a shallow repository to
96 exclude commits reachable from a specified remote branch or tag.
97 This option can be specified multiple times.
98
Nguyễn Thái Ngọc Duycccf74e2016-06-12 17:54:09 +070099--deepen-relative::
100 Argument --depth specifies the number of commits from the
101 current shallow boundary instead of from the tip of each
102 remote branch history.
103
Robert Coup869a0eb2022-03-28 14:02:07 +0000104--refetch::
105 Skips negotiating commits with the server in order to fetch all matching
106 objects. Use to reapply a new partial clone blob/tree filter.
107
Stephan Beyer32402402008-06-08 03:36:09 +0200108--no-progress::
Johannes Schindelin83a5ad62007-02-20 03:01:44 +0100109 Do not show the progress.
110
Nguyễn Thái Ngọc Duy9ba38042013-07-21 15:18:05 +0700111--check-self-contained-and-connected::
112 Output "connectivity-ok" if the received pack is
113 self-contained and connected.
114
Stephan Beyer32402402008-06-08 03:36:09 +0200115-v::
Uwe Kleine-König18bd8822007-01-19 13:43:00 +0100116 Run verbosely.
117
Torsten Bögershausen70cce992013-11-08 18:54:05 +0100118<repository>::
119 The URL to the remote repository.
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -0700120
Junio C Hamano33b83032005-08-12 02:08:29 -0700121<refs>...::
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -0700122 The remote heads to update from. This is relative to
123 $GIT_DIR (e.g. "HEAD", "refs/heads/master"). When
124 unspecified, update from all heads the remote side has.
Gabriel Souza Franco754ecb12016-03-04 22:11:38 -0300125+
David Turnerf8edeaa2016-11-11 12:23:48 -0500126If the remote has enabled the options `uploadpack.allowTipSHA1InWant`,
127`uploadpack.allowReachableSHA1InWant`, or `uploadpack.allowAnySHA1InWant`,
128they may alternatively be 40-hex sha1s present on the remote.
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -0700129
Torsten Bögershausen70cce992013-11-08 18:54:05 +0100130SEE ALSO
131--------
132linkgit:git-fetch[1]
133
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -0700134GIT
135---
Christian Couder9e1f0a82008-06-06 09:07:32 +0200136Part of the linkgit:git[1] suite