git push 遇到missing change id的问题

        完整的错误日志如下:

[java]  view plain  copy
  1. <span style="font-size:14px;">Total 11 (delta 6), reused 0 (delta 0)  
  2. remote: Resolving deltas: 100% (6/6)  
  3. remote: Processing changes: refs: 1, done      
  4. remote: ERROR: missing Change-Id in commit message footer  
  5. remote: Suggestion for commit message:  
  6. remote: Add reverse interface in reverse service.  
  7. remote:   
  8. remote: DONE=#88694  
  9. remote:   
  10. remote: Change-Id: I90ddd8d136212efa6b6cafcc0c6cd971c3113b7f  
  11. remote:   
  12. remote: Hint: To automatically insert Change-Id, install the hook:  
  13. remote:   gitdir=$(git rev-parse --git-dir); scp -p -P 29418 harryhe@10.10.96.212:hooks/commit-msg ${gitdir}/hooks/  
  14. remote:   
  15. remote:   
  16. To ssh://[email protected]:29418/projects/QingGan_OS/framework/base/services/SystemPolicy.git  
  17.  ! [remote rejected] HEAD -> refs/for/master (missing Change-Id in commit message footer)  
  18. error: failed to push some refs to 'ssh://[email protected]:29418/projects/QingGan_OS/framework/base/services/SystemPolicy.git'  
  19. </span>  
错误提示,可以看出Change-Id丢失,导致该错误的原因不清楚。

解决问题步骤如下

1、按照Hint提示,执行命令:

[java]  view plain  copy
  1. gitdir=$(git rev-parse --git-dir); scp -p -P 29418 harryhe@10.10.96.212:hooks/commit-msg ${gitdir}/hooks/  
2、然后重新添加commit,执行命令:

[java]  view plain  copy
  1. git commit --amend  
3、最后重新push,解决问题
发布了22 篇原创文章 · 获赞 25 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/chmodzora/article/details/78465429