Git Reference ยท Configuration Options
http.* settings
Reference for http.* settings: http.proxy, http.sslVerify, http.sslCAInfo, http.extraHeader, http.postBuffer and per-URL overrides such as http.<url>.sslVerify.
The http.* settings control how Git talks to http:// and https:// remotes: proxies, certificate checks, timeouts, protocol version and extra request headers. They matter mostly behind company proxies, with private certificate authorities, or when a server needs a special header.
Every setting can be limited to a URL with http.<url>.<name>. Git picks the most specific matching section, so you can turn off verification for one internal server without weakening it everywhere.
git config --global http.proxy http://proxy.example.com:3128 git config --global http.https://git.internal.example.com.sslCAInfo ~/certs/internal-ca.pem git config --global http.postBuffer 524288000
Try it
Press Run (or Ctrl + Enter) to see the result here.
Program input ยท what you'd type while the program runs
Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.
Press Run (or Ctrl + Enter) to see the result here.
Program input ยท what you'd type while the program runs
Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.
Syntax
git config http.<name> <value> git config http.<url>.<name> <value> git config --get-urlmatch http[.<name>] <url>
| Name | Description |
|---|---|
http.proxy |
Proxy URL (http://, https://, socks5://). An empty value means "no proxy". |
http.sslVerify |
Verify the server certificate (default true). Turning it off removes protection against interception. |
http.sslCAInfo, http.sslCAPath |
Certificate authority bundle file or directory used for verification. |
http.sslCert, http.sslKey |
Client certificate and key (mutual TLS). |
http.sslBackend |
TLS library on builds that support more than one (for example openssl or schannel). |
http.extraHeader |
Add a header to every request, such as Authorization: Bearer ... or a tracing header. Can be repeated. |
http.postBuffer |
Size in bytes above which pushes use chunked transfer. Default about 1 MiB. |
http.version |
Force HTTP/1.1 or HTTP/2. |
http.lowSpeedLimit, http.lowSpeedTime |
Abort a transfer slower than the limit (bytes per second) for that many seconds. |
http.cookieFile, http.saveCookies |
Read cookies from a file, and write them back. |
http.userAgent |
Replace the default git/<version> user agent. |
http.followRedirects |
initial (default), true or false. |
Errors: certificate problems appear as SSL certificate problem: unable to get local issuer certificate; proxy failures as Could not resolve proxy or Failed to connect. A transfer cut by the low-speed limit ends with RPC failed.
Usage notes
- Never disable
http.sslVerifyglobally. Fix the cause instead: add the corporate CA withhttp.sslCAInfo, or limit the exception to one host with the URL form. - URL matching compares scheme, host, optional port, optional user, and a path prefix; the longest matching path wins, and a match without a path loses to one with a path (as the second example shows).
extraHeaderis how tokens are sent without a helper, for examplehttp.https://git.example.com/.extraHeader = Authorization: Basic .... The header lives in plain text in the config file, so protect it.- A large push failing with
RPC failed; HTTP 400is the classic reason to raisehttp.postBuffer, although fixing the server or proxy limit is better. - Proxy environment variables (
http_proxy,https_proxy,no_proxy,all_proxy) are used whenhttp.proxyis unset.GIT_CURL_VERBOSE=1shows what happens on the wire. - HTTP/2 is used when the TLS library and server support it; force HTTP/1.1 if a proxy mangles it.
- Host-specific proxies go in one config line each:
http.<url>.proxy.