Merge branch 'jk/free-tree-buffer'
[gitweb.git] / Documentation / git-config.txt
index 34b089464627fc66c5a734adc7699fcceaff7c4f..e9917b89a91b36c87892ea1c08522f17be3c0d89 100644 (file)
@@ -15,6 +15,7 @@ SYNOPSIS
 'git config' [<file-option>] [type] [-z|--null] --get name [value_regex]
 'git config' [<file-option>] [type] [-z|--null] --get-all name [value_regex]
 'git config' [<file-option>] [type] [-z|--null] --get-regexp name_regex [value_regex]
+'git config' [<file-option>] [type] [-z|--null] --get-urlmatch name URL
 'git config' [<file-option>] --unset name [value_regex]
 'git config' [<file-option>] --unset-all name [value_regex]
 'git config' [<file-option>] --rename-section old_name new_name
@@ -95,30 +96,40 @@ OPTIONS
        in which section and variable names are lowercased, but subsection
        names are not.
 
+--get-urlmatch name URL::
+       When given a two-part name section.key, the value for
+       section.<url>.key whose <url> part matches the best to the
+       given URL is returned (if no such key exists, the value for
+       section.key is used as a fallback).  When given just the
+       section as name, do so for all the keys in the section and
+       list them.
+
 --global::
-       For writing options: write to global ~/.gitconfig file rather than
-       the repository .git/config, write to $XDG_CONFIG_HOME/git/config file
-       if this file exists and the ~/.gitconfig file doesn't.
+       For writing options: write to global `~/.gitconfig` file
+       rather than the repository `.git/config`, write to
+       `$XDG_CONFIG_HOME/git/config` file if this file exists and the
+       `~/.gitconfig` file doesn't.
 +
-For reading options: read only from global ~/.gitconfig and from
-$XDG_CONFIG_HOME/git/config rather than from all available files.
+For reading options: read only from global `~/.gitconfig` and from
+`$XDG_CONFIG_HOME/git/config` rather than from all available files.
 +
 See also <<FILES>>.
 
 --system::
-       For writing options: write to system-wide $(prefix)/etc/gitconfig
-       rather than the repository .git/config.
+       For writing options: write to system-wide
+       `$(prefix)/etc/gitconfig` rather than the repository
+       `.git/config`.
 +
-For reading options: read only from system-wide $(prefix)/etc/gitconfig
+For reading options: read only from system-wide `$(prefix)/etc/gitconfig`
 rather than from all available files.
 +
 See also <<FILES>>.
 
 --local::
-       For writing options: write to the repository .git/config file.
+       For writing options: write to the repository `.git/config` file.
        This is the default behavior.
 +
-For reading options: read only from the repository .git/config rather than
+For reading options: read only from the repository `.git/config` rather than
 from all available files.
 +
 See also <<FILES>>.
@@ -218,9 +229,9 @@ $(prefix)/etc/gitconfig::
 
 $XDG_CONFIG_HOME/git/config::
        Second user-specific configuration file. If $XDG_CONFIG_HOME is not set
-       or empty, $HOME/.config/git/config will be used. Any single-valued
+       or empty, `$HOME/.config/git/config` will be used. Any single-valued
        variable set in this file will be overwritten by whatever is in
-       ~/.gitconfig.  It is a good idea not to create this file if
+       `~/.gitconfig`.  It is a good idea not to create this file if
        you sometimes use older versions of Git, as support for this
        file was added fairly recently.
 
@@ -293,6 +304,13 @@ Given a .git/config like this:
                gitproxy=proxy-command for kernel.org
                gitproxy=default-proxy ; for all the rest
 
+       ; HTTP
+       [http]
+               sslVerify
+       [http "https://weak.example.com"]
+               sslVerify = false
+               cookieFile = /tmp/cookie.txt
+
 you can set the filemode to true with
 
 ------------
@@ -378,6 +396,19 @@ RESET=$(git config --get-color "" "reset")
 echo "${WS}your whitespace color or blue reverse${RESET}"
 ------------
 
+For URLs in `https://weak.example.com`, `http.sslVerify` is set to
+false, while it is set to `true` for all others:
+
+------------
+% git config --bool --get-urlmatch http.sslverify https://good.example.com
+true
+% git config --bool --get-urlmatch http.sslverify https://weak.example.com
+false
+% git config --get-urlmatch http https://weak.example.com
+http.cookiefile /tmp/cookie.txt
+http.sslverify false
+------------
+
 include::config.txt[]
 
 GIT