【工具篇】git

145 阅读2分钟

拉取出错

1. 代理出错

OpenSSL SSL_read: Connection was reset, errno 10054/Failed to connect to github.com port 443 after 21086 ms: Timed out

错误信息

fatal: unable to access 'github.com/xxxxx/xxx.g… OpenSSL SSL_read: Connection was reset, errno 10054

fatal: unable to access 'github.com/xxxxx/xxx.g… Failed to connect to github.com port 443 after 21086 ms: Timed out

出现原因

网页代理原因

解决方法

关闭网页代理

2. SSL证书

SSL certificate problem: unable to get local issuer certificate

错误信息

解决方案

显示SSL证书问题,关闭git的SSL验证即可解决

git config --global http.sslVerify false

执行完git命令,关闭ssl验证,再次拉取,成功!

提交出错

1.running pre-commit hook:lint-staged [STARTED] Preparing... [SUCCESS]

错误信息

0 files committed, 1 file failed to commit: 修改密码点击眼睛信息

running pre-commit hook: lint-staged [STARTED] Preparing... [SUCCESS] Preparing... [STARTED] Running tasks... [STARTED] Running tasks for *.{js,jsx,vue} [STARTED] vue-cli-service lint [FAILED] vue-cli-service lint [FAILED] [SUCCESS] Running tasks... [STARTED] Applying modifications... [SKIPPED] Skipped because of errors from tasks. [STARTED] Reverting to original state because of errors... [SUCCESS] Reverting to original state because of errors... [STARTED] Cleaning up... [SUCCESS] Cleaning up... [91m✖ vue-cli-service lint: E:\vue2\src\views\login\index.vue 39:11 error Component name "login" should always be multi-word vue/multi-word-component-names ✖ 1 problem (1 error, 0 warnings) pre-commit hook failed (add --no-verify to bypass)

出现原因

错误的意思是大概是有一个钩子,提交前检查项目代码的规范,eslint的检查。提交失败的原因:项目中error过多,导致检测未通过,提交失败。

解决方法

需要git在提交时不进行检查,也就是删除pre-commit hook,具体位置在项目文件夹中的.git\hooks目录下,找到pre-commit(没有后缀名的那个)删除即可。如果找不到.git文件夹的话,是因为.git是隐藏文件夹,需要将文件夹的显示隐藏的项目开启