Git ignores ssl authentication and git must enter the account number and password every time the code is submitted

When you access the Git remote warehouse through HTTPS, if the SSL certificate of the server is not signed by a third-party organization, Git will report an error. This is a very reasonable design, after all, unknown unsigned certificates represent a great security risk.

Solution
In the first step, when cloning the remote warehouse, use the env command to set the GIT_SSL_NO_VERIFY environment variable to "true", and call the normal git clone command at the same time. The complete command is as follows:
Bash code

export GIT_SSL_NO_VERIFY=true

git clone https://host_name/git/project.git

or in a single line:

env GIT_SSL_NO_VERIFY=true  git clone https://host_name/git/project.git

In the second step, set http.sslVerify to "false" in the cloned warehouse. The complete command is as follows:
Bash code

git config --global http.sslVerify false

The above method should be a good way for Git to handle trusted SSL temporary certificates. The first step is to use the env command to ensure that ignoring certificate errors is a one-time behavior and will not become the default setting. The second time, the setting of ignoring certificate errors is limited to a specific warehouse to avoid potential security risks caused by expanding the scope of application of the setting.

Solve the problem that git needs to enter the account number and password every time the code is submitted.
Execute the following command
1. Add the user name and password to the configuration file on the client side
#Save identity information

git config --global credential.helper store

When submitting next time, after entering the account number and password once, there is no need to enter it again

Guess you like

Origin blog.csdn.net/m0_49016709/article/details/125098741