How do I set GIT_SSL_NO_VERIFY for specific repos only?

前端 未结 11 1992
迷失自我
迷失自我 2020-12-02 03:12

I have to use a git server without proper certificates, but I don\'t want to have to do

env GIT_SSL_NO_VERIFY=true git command

every single

11条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-02 04:12

    This question keeps coming up and I did not find a satisfying result yet, so here is what worked for me (based on a previous answer https://stackoverflow.com/a/52706362/1806760, which is not working):

    My server is https://gitlab.dev with a self-signed certificate.

    First run git config --system --edit (from an elevated command prompt, change --system to --global if you want to do it for just your user), then insert the following snippet after any previous [http] sections:

    [http "https://gitlab.dev"]
            sslVerify = false
    

    Then check if you did everything correctly:

    > git config --type=bool --get-urlmatch http.sslVerify https://gitlab.dev
    false
    

提交回复
热议问题