git push 错误

错误信息

bash 复制代码
git push origin HEAD:refs/for/master
Enumerating objects: 256, done.
Counting objects: 100% (256/256), done.
Delta compression using up to 4 threads
Compressing objects: 100% (225/225), done.
Writing objects: 100% (255/255), 5.86 MiB | 18.98 MiB/s, done.
Total 255 (delta 40), reused 94 (delta 12), pack-reused 0
remote: Resolving deltas: 100% (40/40)
remote: Processing changes: refs: 1, done
remote: ERROR: commit 2491cd0: missing Change-Id in message footer
remote:
remote: Hint: to automatically insert a Change-Id, install the hook:
remote:   gitdir=$(git rev-parse --git-dir); scp -p -P 29418 wangjicong@192.168.0.240:hooks/commit-msg ${gitdir}/hooks/
remote: and then amend the commit:
remote:   git commit --amend --no-edit
remote: Finally, push your changes again
remote:
To ssh://192.168.0.240:29418/MeiGLink
 ! [remote rejected]     HEAD -> refs/for/master (commit 2491cd0: missing Change-Id in message footer)
error: failed to push some refs to 'ssh://192.168.0.240:29418/MeiGLink'

解决

需要将上述提示scp -p -P 29418 wangjicong@192.168.0.240:hooks/commit-msg ${gitdir}/hooks/ 中的-p修改为-O(大写字母O)

bash 复制代码
gitdir=$(git rev-parse --git-dir);
scp -O -P 29418 wangjicong@192.168.0.240:hooks/commit-msg ${gitdir}/hooks/
git commit --amend --no-edit
相关推荐
好好沉淀4 小时前
ide进去git突然报Cannot identify version of git executable: no response的错误
git
宇宙超级无敌霸王龙捏8 小时前
Git 分支完整操作指南
git
学编程的小鬼11 小时前
git 中常用的命令
git
小黄酥12 小时前
Sourcetree克隆/获取gitee工程,Git获取SSH密钥
git·gitee·github
小Lu的开源日常13 小时前
踩坑日记:为什么 .gitignore 不起作用了
git·代码规范·trae
Gazer_S17 小时前
【Git 子模块冲突解析】
git
她说..17 小时前
通过git拉取前端项目
java·前端·git·vscode·拉取代码
freedom_1024_17 小时前
解决GitHub大文件推送错误:彻底清理PDB文件并配置.gitignore
git·github
未来的JAVA高级开发工程师17 小时前
Git--
git
sitellla20 小时前
Testify Go测试工具包入门教程
git·测试工具·其他·golang