5

Similar to how you can set Git config options for a specific URL like

git config http."https://code.example.com/".sslVerify false

I'd like to set them for all subdomains. How can I use wildcards? The following doesn't seem to work

git config http."https://*.mycompany.com/".sslCAInfo <downloaded certificate>.pem

Community
  • 1
  • 1
bbodenmiller
  • 3,101
  • 5
  • 34
  • 50
  • 1
    With Git 2.13 (Q2 2017), your syntax will actually work! See [my answer below](http://stackoverflow.com/a/43056419/6309). – VonC Mar 27 '17 at 21:01

2 Answers2

7

How can I use wildcards?

With Git 2.13 (Q2 2017), you will be able to use wildcards!

See commit a272b9e, commit af99049, commit 3ec6e6e, commit 3e6a0e6, commit 3343995 (31 Jan 2017) by Patrick Steinhardt (pks-t).
Helped-by: Junio C Hamano (gitster).
(Merged by Junio C Hamano -- gitster -- in commit a411726, 27 Feb 2017)

urlmatch: allow globbing for the URL host part

The <url> part in "http.<url>.<variable>" configuration variable can now be spelled with '*' that serves as wildcard.

E.g. "http.https://*.example.com.proxy" can be used to specify the proxy used for https://a.example.com, https://b.example.com, etc., i.e. any host in the example.com domain.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

The analysis of the host matching part in git's url matching procedure suggests that wildcards are not supported:

/* check the host and port */
if (url_prefix->host_len != url->host_len ||
    strncmp(url->url + url->host_off,
            url_prefix->url + url_prefix->host_off, url->host_len))
        return 0; /* host names and/or ports do not match */
Leon
  • 31,443
  • 4
  • 72
  • 97