How do I set GIT_SSL_NO_VERIFY for specific repos only?

前端 未结 11 1958
迷失自我
迷失自我 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:05

    You can do as follows

    For a single repo

    git config http.sslVerify false
    

    For all repo

    git config --global http.sslVerify false
    
    0 讨论(0)
  • 2020-12-02 04:05

    This works for me:

    git init
    git config --global http.sslVerify false
    git clone https://myurl/myrepo.git
    
    0 讨论(0)
  • 2020-12-02 04:08

    In particular if you need recursive clone

    GIT_SSL_NO_VERIFY=true git clone --recursive https://github.com/xx/xx.git
    
    0 讨论(0)
  • 2020-12-02 04:10

    You can do

    git config http.sslVerify "false"
    

    in your specific repo to disable SSL certificate checking for that repo only.

    0 讨论(0)
  • 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
    
    0 讨论(0)
提交回复
热议问题