summaryrefslogtreecommitdiffstats
path: root/git-upload-pack.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-05-14 07:53:46 -0700
committerJunio C Hamano <gitster@pobox.com>2024-05-14 07:53:46 -0700
commit81632a6851a67a669f4118f317c4c317597f3580 (patch)
treed2134236e1e1eeac75b067ffea4f230cae79baa8 /git-upload-pack.txt
parent1365ca3bda21f91694f354abdb3459692fcbcf1c (diff)
downloadgit-htmldocs-81632a6851a67a669f4118f317c4c317597f3580.tar.gz
Autogenerated HTML docs for v2.45.1-145-g83f1a
Diffstat (limited to 'git-upload-pack.txt')
-rw-r--r--git-upload-pack.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/git-upload-pack.txt b/git-upload-pack.txt
index 7ad60bc34..516d1639d 100644
--- a/git-upload-pack.txt
+++ b/git-upload-pack.txt
@@ -55,6 +55,37 @@ ENVIRONMENT
admins may need to configure some transports to allow this
variable to be passed. See the discussion in linkgit:git[1].
+`GIT_NO_LAZY_FETCH`::
+ When cloning or fetching from a partial repository (i.e., one
+ itself cloned with `--filter`), the server-side `upload-pack`
+ may need to fetch extra objects from its upstream in order to
+ complete the request. By default, `upload-pack` will refuse to
+ perform such a lazy fetch, because `git fetch` may run arbitrary
+ commands specified in configuration and hooks of the source
+ repository (and `upload-pack` tries to be safe to run even in
+ untrusted `.git` directories).
++
+This is implemented by having `upload-pack` internally set the
+`GIT_NO_LAZY_FETCH` variable to `1`. If you want to override it
+(because you are fetching from a partial clone, and you are sure
+you trust it), you can explicitly set `GIT_NO_LAZY_FETCH` to
+`0`.
+
+SECURITY
+--------
+
+Most Git commands should not be run in an untrusted `.git` directory
+(see the section `SECURITY` in linkgit:git[1]). `upload-pack` tries to
+avoid any dangerous configuration options or hooks from the repository
+it's serving, making it safe to clone an untrusted directory and run
+commands on the resulting clone.
+
+For an extra level of safety, you may be able to run `upload-pack` as an
+alternate user. The details will be platform dependent, but on many
+systems you can run:
+
+ git clone --no-local --upload-pack='sudo -u nobody git-upload-pack' ...
+
SEE ALSO
--------
linkgit:gitnamespaces[7]