yaoningvital / blog

my blog
31 stars 4 forks source link

gerrit中,push时提示 ! [remote rejected] HEAD -> refs/for/master (change XXXX closed) #142

Open yaoningvital opened 5 years ago

yaoningvital commented 5 years ago

1、情景描述

在gerrit中push时,提示: image

2、问题分析

原因是commit的changeId已经过期, 即 http://gerrit.it.ikang.com:8080/c/fe/ikang-company-employees/+/1152 已经关闭,不能直接push。

3、解决方案

(1)git commit --amend

image

(2)delete change Id

image

(3)save and quit

在vim环境,按'ZZ'退出。 image

(4)new change id will be added to the commit. it can be verified by git log.

(5)push again