Git 远程和 GIT_SSL_NO_VERIFY

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20021261/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:21:51  来源:igfitidea点击:

Git remote and GIT_SSL_NO_VERIFY

git

提问by grogsy

I have repository with SSH verification, but also I have second repository with clone method (GIT_SSL_NO_VERIFY=true git clone git-address).

我有带 SSH 验证的存储库,但我还有第二个带克隆方法的存储库 (GIT_SSL_NO_VERIFY=true git clone git-address)。

How I can add second repository (git remote add ...)?

我如何添加第二个存储库(git remote add ...)?

回答by janos

One thing you can do is prefix your command with GIT_SSL_NO_VERIFY=true, for example:

您可以做的一件事是在命令前加上GIT_SSL_NO_VERIFY=true,例如:

GIT_SSL_NO_VERIFY=true git remote add

And, every time you need to work with that remote, for example whenever you do a clone, fetch, or pull, you will have to prefix them like that.

而且,每次您需要使用该遥控器时,例如,无论何时进行克隆、获取或拉取,您都必须像这样为它们添加前缀。

Another solution is to export the variable:

另一种解决方案是导出变量:

export GIT_SSL_NO_VERIFY=true

This way it will apply to all commands, no need to prefix it. That's also its drawback, as it will be applied for all other Git repos as well.

这样它将适用于所有命令,无需为其添加前缀。这也是它的缺点,因为它也将应用于所有其他 Git 存储库。

The best solution is to set the http.sslVerifyconfig value of the repo to false, like this:

最好的解决方案是http.sslVerify将 repo的配置值设置为 false,如下所示:

git config http.sslVerify "false"