VS Code下git的ca-bundle.crt问题

今天在vs code下上传项目到github出现了这个问题:

fatal: unable to access https://github.com/*********.git/: error setting certificate verify locations: CAfile: D:/***/Git/mingw64/ssl/certs/ca-bundle.crt CApath: none

看到是git安装位置下的证书位置出错。

然后打开终端输入

git config --system http.sslcainfo "D:a_youwantGitmingw64sslcertsca-bundle.crt"

发现命令错误,一顿操作发现git bash终端没有配置,接着开始按照下列步骤配置终端:

点击左下角设置 -> 输入shell -> Terminal › Integrated › Automation Shell: Windows下在json中编辑。

按照自己需求修改,我把我的页面都拷贝过来了:

{
	"folders": [
		{
			"path": "."
		}
	],
	"settings": {
		"terminal.integrated.profiles.windows": {
			"JavaScript Debug Terminal": {
			  // 自己的安装路径, 是bin下的bash.exe,别写错了
			  "path": "D:\a_youwant\Gitin\bash.exe",
				// 使自定义命令的别名生效
				"args": [
				  "-l"
				]
			}
		  },
			// 下面这里的这个名称, 换成别的, 会提示有错误, 但是不影响使用
			// 因为个人有强迫症, 看不得那个圆角提示
		"terminal.integrated.defaultProfile.windows": "JavaScript Debug Terminal",
		"files.associations": {
			"*.ipp": "c",
			"*.inc": "c",
			"random": "c",
			"dhm.h": "c"
		}
	}
}

(在此感谢不知名大神提供的部分代码)

接着保存退出,选中下面选项:

重新打开一个终端,输入:

git config --system http.sslcainfo "D:a_youwantGitmingw64sslcertsca-bundle.crt"

再去上传发现都OK了。

经验分享 程序员 微信小程序 职场和发展