问题背景:
在使用git commit命令进行提交时遇到报错
git: 'interpret-trailers' is not a git command. See 'git --help'.
cannot insert change-id line in .git/COMMIT_EDITMSG
问题原因:
git版本老旧
在命令行中使用 git --version 查看当前版本为1点几(本机git已上升为2以上,线上开发机一天版本仍为1点几,因此线上提交时遇到报错)
尝试:
1.直接去官网下载
2.系统中无brew,因此此路也不准备使用
3.最后解决办法
卸载老版本git,我使用的是第一句
sudo yum -y remove git
sudo yum -y remove git-*
添加 End Point 到 CentOS 7 仓库
sudo yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
安装新版本
sudo yum -y install git
最后再次检查当前git版本
git --version
此时git版本与官网一致