git commit -m "XX"报错 pre -commit hook failed (add --no-verify to bypass)问题
在同步本地文件到线上仓库的时候
报错 pre -commit hook failed (add --no-verify to bypass)
当你在终端输入git commit -m "xxx",提交代码的时候,
pre-commit(客户端)钩子,它会在Git键入提交信息前运行做代码风格检查。
如果代码不符合相应规则,则报错。
虽然会提示add --no-verify,输入 git commit -m "xxx" --no-verify 绕过验证,强制提交。但是不一定能提交成功。
简单粗暴的解决方法:
暴力把pre-commit钩子删除掉。
具体步骤:
1.进入项目的.git文件夹(文件夹默认隐藏,可先设置显示或者命令ls查找)
2.再进入hooks文件夹
3.删除pre-commit文件
4.重新git commit -m "xxx" git push 即可
总结一句话: 删除.git的提交规则文件: rm -rf ./git/hooks/pre-commit
最后忠告: 这是不得已的办法。如果是日常开发,还是要写好代码的规范,现在代码一般都会进行ESLint校验,如果觉得麻烦的话,可以装一个Prettier插件,帮你格式化代码。
git commit -m "XX"报错 pre -commit hook failed (add --no-verify to bypass)问题的更多相关文章
- win10 git 报错 Host key verification failed
从code.aliyun.com切回github 原先的known_hosts里记录的是code.aliyun.com的ip,必须新加一个github的. known_hosts报错Host key ...
- nginx: [emerg] unknown directive “ ” in /usr/local/nginx/nginx.conf.conf:xx报错处理
当我们在修改Nginx的配置文件,然后加载配置文件./nginx -s reload 报错类似的错误, nginx: [emerg] unknown directive “ ” in /usr/l ...
- Git无法提交,报错
Failed at the ant-design-pro@2.2.1 lint-staged script. npm ERR! This is probably not a problem with ...
- jenkins报错 Host key verification failed.
一.Host key verification failed 问题描述 在本地windows机器上安装了jenkins,在git bash命令行窗口可以使用git pull命令,但是在jenkins ...
- python——报错ImportError:DLL load failed with error code -1073741795的解决方式
python中导入一个包,import cv2总是报错'ImportError:DLL load failed with error code -1073741795',报错形式: 网上找了好久的解决 ...
- iOS报错:linker command failed with exit code 1 (use -v to see invocation) 问题解决方式之一
百度库原版本:3.2.1 更新为:4.2.0,两个库相隔2年时间: 问题i: 更新CocoaPods的同时更新了百度地图库的版本,运行程序报错: linker command failed with ...
- php curl报错:417 - Expectation Failed
当我在post提交的数据增加一段内容后会报错:417 - Expectation Failed. 查资料发现在使用curl做POST时,当post的数据大于1024字节时,curl并不会直接发起pos ...
- 配置web pack loader 报错:Module build failed: Error: The node API for `babel` has been moved to `babel-core`.
报错如下 Module build failed: Error: The node API for `babel` has been moved to `babel-core`. 在我配置loader ...
- ssh 报错Host key verification failed 或Ubuntu connect to serve 失败
ssh 报错Host key verification failed 或Ubuntu connect to serve 失败 通常是因为没有装ssh sudo apt-get install o ...
随机推荐
- C#面向对象17 23种设计模式
1.简单工厂模式 using System; using System.Collections.Generic; using System.Linq; using System.Text; using ...
- Java list的实现类
Java list的实现类 本文是根据博文整理 Java中,List接口一共有三个实现类:ArrayList.Vector和LinkedList. 其中ArrayList和Vector都是利用数组这一 ...
- centos配置LVS
LVS有三种工作模式:NAT, TUN, DR. DR是三种工作模式中性能最高的,TUN次之. 本文记录LVS/TUN和LVS/DR工作模式的配置过程. 环境: 三台CentOS 7 x64 虚拟机 ...
- HTML的学习2(代码)
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- react中怎么写css样式?
JSX基本语法中关于react如何写css样式主要有三种方法 1.基于class --(className) 基于className ,通过className在style中给该class名的DOM元素 ...
- centos7常见问题(更新。。。)
1.网络设置 装好CentOS7后,我们一开始是上不了网的 DHCP 这时候,可以输入命令dhclient,可以自动获取一个IP地址,再用命令ip addr查看IP 不过这时候获取的IP是动态的,下次 ...
- mybatis报错,There is no getter for property named 'templateName' in 'class
There is no getter for property named 'templateName' in 'class 主要原因是因为mapper.xml 的语句有错误,导致在bean里找不到相 ...
- vim 去掉自动注释和自动回车
取消 :set paste 恢复 :set paste!
- Oracle笔记(九) 表的创建及管理
对于数据库而言实际上每一张表都表示的是一个数据库的对象,而数据库对象指的就是DDL定义的所有操作,例如:表.视图.索引.序列.约束等等,都属于对象的操作,所以表的建立就是对象的建立,而对象的操作主要分 ...
- blucesun 解决npm报错:Module build failed: TypeError: this.getResolve is not a function
1.sass-loader的版本过高导致的编译错误,当前最高版本是8.x,需要退回到7.3.1 运行: npm uninstall sass-loader(卸载当前版本) npm install sa ...