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 [email protected]: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 [email protected]:hooks/commit-msg ${gitdir}/hooks/ 中的-p修改为-O(大写字母O)

bash 复制代码
gitdir=$(git rev-parse --git-dir);
scp -O -P 29418 [email protected]:hooks/commit-msg ${gitdir}/hooks/
git commit --amend --no-edit
相关推荐
范纹杉想快点毕业6 小时前
以项目的方式学QT开发(一)——超详细讲解(120000多字详细讲解,涵盖qt大量知识)逐步更新!
c语言·数据结构·c++·git·qt·链表·github
qq_653644468 小时前
如何查看打开的 git bash 窗口是否是管理员权限打开
开发语言·windows·git·bash
tonngw8 小时前
【Mac 从 0 到 1 保姆级配置教程 12】- 安装配置万能的编辑器 VSCode 以及常用插件
git·vscode·后端·macos·开源·编辑器·github
橄榄熊10 小时前
Git 常用命令详解
git
o(╥﹏╥)1 天前
绑定 SSH key(macos)
开发语言·git·学习·macos
半新半旧1 天前
Git 分支指南
git
qq_464357011 天前
git中忽略文件.gitignore文件的用法
git
程序员阿鹏2 天前
Git的安装和配置(idea中配置Git)
java·开发语言·ide·git·intellij-idea·idea
belldeep2 天前
如何阅读、学习 Git 核心源代码 ?
git·学习·源代码
我不是秃头sheep2 天前
Git安装教程及常用命令
git