Nguyễn Thái Ngọc Duy | dd55172 | 2018-10-27 08:23:25 +0200 | [diff] [blame] | 1 | protocol.allow:: |
| 2 | If set, provide a user defined default policy for all protocols which |
| 3 | don't explicitly have a policy (`protocol.<name>.allow`). By default, |
Taylor Blau | a1d4f67 | 2022-07-29 15:22:13 -0400 | [diff] [blame^] | 4 | if unset, known-safe protocols (http, https, git, ssh) have a |
Nguyễn Thái Ngọc Duy | dd55172 | 2018-10-27 08:23:25 +0200 | [diff] [blame] | 5 | default policy of `always`, known-dangerous protocols (ext) have a |
Taylor Blau | a1d4f67 | 2022-07-29 15:22:13 -0400 | [diff] [blame^] | 6 | default policy of `never`, and all other protocols (including file) |
| 7 | have a default policy of `user`. Supported policies: |
Nguyễn Thái Ngọc Duy | dd55172 | 2018-10-27 08:23:25 +0200 | [diff] [blame] | 8 | + |
| 9 | -- |
| 10 | |
| 11 | * `always` - protocol is always able to be used. |
| 12 | |
| 13 | * `never` - protocol is never able to be used. |
| 14 | |
| 15 | * `user` - protocol is only able to be used when `GIT_PROTOCOL_FROM_USER` is |
| 16 | either unset or has a value of 1. This policy should be used when you want a |
| 17 | protocol to be directly usable by the user but don't want it used by commands which |
| 18 | execute clone/fetch/push commands without user input, e.g. recursive |
| 19 | submodule initialization. |
| 20 | |
| 21 | -- |
| 22 | |
| 23 | protocol.<name>.allow:: |
| 24 | Set a policy to be used by protocol `<name>` with clone/fetch/push |
| 25 | commands. See `protocol.allow` above for the available policies. |
| 26 | + |
| 27 | The protocol names currently used by git are: |
| 28 | + |
| 29 | -- |
| 30 | - `file`: any local file-based path (including `file://` URLs, |
| 31 | or local paths) |
| 32 | |
| 33 | - `git`: the anonymous git protocol over a direct TCP |
| 34 | connection (or proxy, if configured) |
| 35 | |
| 36 | - `ssh`: git over ssh (including `host:path` syntax, |
| 37 | `ssh://`, etc). |
| 38 | |
| 39 | - `http`: git over http, both "smart http" and "dumb http". |
| 40 | Note that this does _not_ include `https`; if you want to configure |
| 41 | both, you must do so individually. |
| 42 | |
| 43 | - any external helpers are named by their protocol (e.g., use |
| 44 | `hg` to allow the `git-remote-hg` helper) |
| 45 | -- |
| 46 | |
| 47 | protocol.version:: |
Jonathan Nieder | b9ab170 | 2019-12-23 17:00:00 -0800 | [diff] [blame] | 48 | If set, clients will attempt to communicate with a server |
| 49 | using the specified protocol version. If the server does |
| 50 | not support it, communication falls back to version 0. |
Jeff King | eb04975 | 2020-09-25 14:34:36 -0400 | [diff] [blame] | 51 | If unset, the default is `2`. |
Nguyễn Thái Ngọc Duy | dd55172 | 2018-10-27 08:23:25 +0200 | [diff] [blame] | 52 | Supported versions: |
| 53 | + |
| 54 | -- |
| 55 | |
| 56 | * `0` - the original wire protocol. |
| 57 | |
| 58 | * `1` - the original wire protocol with the addition of a version string |
| 59 | in the initial response from the server. |
| 60 | |
| 61 | * `2` - link:technical/protocol-v2.html[wire protocol version 2]. |
| 62 | |
| 63 | -- |