Git missing Change-Id in commit message footer解决方法

Git missing Change-Id in commit message footer解决方法
在Git向服务器提交代码时,出现如下错误
missing Change-Id in commit message footer
1
原因:项目仓库.git/hooks目录下,commit-msg文件缺失。
解决方法1:一般在提交代码报错时,会给出相应解决的提示。

remote: Processing changes: refs: 1, done 
remote: ERROR: missing Change-Id in commit message footer
remote: 
remote: Hint: To automatically insert Change-Id, install the hook:
remote: gitdir=$(git rev-parse --git-dir); scp -p -P 29418 xxxxx@xxxx:hooks/commit-msg ${gitdir}/hooks/
remote: And then amend the commit:
remote: git commit --amend

 


如上所示,依次在项目路径下输入如下命令,即可解决:

gitdir=$(git rev-parse --git-dir); 
# 将xxxxx@xxxx 替换成相应用户名、服务器即可(该命令从服务器拷贝commit-msg文件)
scp -p -P 29418 xxxxx@xxxx:hooks/commit-msg ${gitdir}/hooks/
# 再提交一次即可生成change-id
git commit --amend

解决办法2:其实和上面的办法差不多,如果将当前项目留有备份,直接将备份项目的.git/hooks/commit-msg拷贝到,当前项目相应目录即可。

原文:https://blog.csdn.net/zxc024000/article/details/83824550

转载于:https://www.cnblogs.com/Ph-one/p/11046374.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值