blob: 516d1639d9d05cb0cb1aba71c9dcedd8d4e8e8c4 [file] [log] [blame]
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -07001git-upload-pack(1)
2==================
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -07003
4NAME
5----
Junio C Hamanoc3f0baa2007-01-18 15:53:37 -08006git-upload-pack - Send objects packed back to git-fetch-pack
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -07007
8
9SYNOPSIS
10--------
Martin von Zweigbergk7791a1d2011-07-01 22:38:26 -040011[verse]
Antoine Queru9812f212016-05-31 11:57:08 +020012'git-upload-pack' [--[no-]strict] [--timeout=<n>] [--stateless-rpc]
13 [--advertise-refs] <directory>
Andreas Heidukad471942018-10-22 22:45:43 +020014
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -070015DESCRIPTION
16-----------
Thomas Rast0b444cd2010-01-10 00:33:00 +010017Invoked by 'git fetch-pack', learns what
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -070018objects the other side is missing, and sends them after packing.
19
20This command is usually not invoked directly by the end user.
Thomas Rast0b444cd2010-01-10 00:33:00 +010021The UI for the protocol is on the 'git fetch-pack' side, and the
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -070022program pair is meant to be used to pull updates from a remote
Thomas Rast0b444cd2010-01-10 00:33:00 +010023repository. For push operations, see 'git send-pack'.
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -070024
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -070025OPTIONS
26-------
Johannes Schindelin83a5ad62007-02-20 03:01:44 +010027
Antoine Queru9812f212016-05-31 11:57:08 +020028--[no-]strict::
Elijah Newren384f7d12023-10-08 06:45:05 +000029 Do not try <directory>/.git/ if <directory> is not a Git directory.
Johannes Schindelin83a5ad62007-02-20 03:01:44 +010030
Stephan Beyer32402402008-06-08 03:36:09 +020031--timeout=<n>::
Johannes Schindelin83a5ad62007-02-20 03:01:44 +010032 Interrupt transfer after <n> seconds of inactivity.
33
Antoine Queru9812f212016-05-31 11:57:08 +020034--stateless-rpc::
35 Perform only a single read-write cycle with stdin and stdout.
36 This fits with the HTTP POST request processing model where
37 a program may read the request, write a response, and must exit.
38
Ævar Arnfjörð Bjarmason98e2d9d2021-08-05 03:25:43 +020039--http-backend-info-refs::
40 Used by linkgit:git-http-backend[1] to serve up
41 `$GIT_URL/info/refs?service=git-upload-pack` requests. See
Ævar Arnfjörð Bjarmason1e232012022-08-04 18:28:41 +020042 "Smart Clients" in linkgit:gitprotocol-http[5] and "HTTP
Jacob Stopakc9dba102022-09-11 03:23:20 -070043 Transport" in the linkgit:gitprotocol-v2[5]
Ævar Arnfjörð Bjarmason1e232012022-08-04 18:28:41 +020044 documentation. Also understood by
Ævar Arnfjörð Bjarmason98e2d9d2021-08-05 03:25:43 +020045 linkgit:git-receive-pack[1].
Antoine Queru9812f212016-05-31 11:57:08 +020046
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -070047<directory>::
48 The repository to sync from.
49
Jeff King2834a722021-09-10 10:09:56 -040050ENVIRONMENT
51-----------
52
53`GIT_PROTOCOL`::
54 Internal variable used for handshaking the wire protocol. Server
55 admins may need to configure some transports to allow this
56 variable to be passed. See the discussion in linkgit:git[1].
57
Jeff King7b70e9e2024-04-16 04:35:33 -040058`GIT_NO_LAZY_FETCH`::
59 When cloning or fetching from a partial repository (i.e., one
60 itself cloned with `--filter`), the server-side `upload-pack`
61 may need to fetch extra objects from its upstream in order to
62 complete the request. By default, `upload-pack` will refuse to
63 perform such a lazy fetch, because `git fetch` may run arbitrary
64 commands specified in configuration and hooks of the source
65 repository (and `upload-pack` tries to be safe to run even in
66 untrusted `.git` directories).
67+
68This is implemented by having `upload-pack` internally set the
69`GIT_NO_LAZY_FETCH` variable to `1`. If you want to override it
70(because you are fetching from a partial clone, and you are sure
71you trust it), you can explicitly set `GIT_NO_LAZY_FETCH` to
72`0`.
73
Jeff Kinge69ac422024-04-16 04:52:13 -040074SECURITY
75--------
76
77Most Git commands should not be run in an untrusted `.git` directory
78(see the section `SECURITY` in linkgit:git[1]). `upload-pack` tries to
79avoid any dangerous configuration options or hooks from the repository
80it's serving, making it safe to clone an untrusted directory and run
81commands on the resulting clone.
82
83For an extra level of safety, you may be able to run `upload-pack` as an
84alternate user. The details will be platform dependent, but on many
85systems you can run:
86
87 git clone --no-local --upload-pack='sudo -u nobody git-upload-pack' ...
88
Josh Triplettd49483f2011-07-08 16:14:10 -070089SEE ALSO
90--------
91linkgit:gitnamespaces[7]
92
Junio C Hamano8b3d9dc2005-07-14 00:08:37 -070093GIT
94---
Christian Couder9e1f0a82008-06-06 09:07:32 +020095Part of the linkgit:git[1] suite