Gerrit error when Change-Id in commit messages are missing

前端 未结 12 1191
北荒
北荒 2020-11-28 03:58

I set up a branch in the remote repository and made some commits on that branch. Now I want to merge the remote branch to the remote master.

Basically follows are my

12条回答
  •  死守一世寂寞
    2020-11-28 04:41

    I got this error message too.

    and what makes me think it is useful to give an answer here is that the answer from @Rafał Rawicki is a good solution in some cases but not for all circumstances. example that i met:

    1.run "git log" we can get the HEAD commit change-id
    
    2.we also can get a 'HEAD' commit change-id on Gerrit website.
    
    3.they are different ,which makes us can not push successfully and get the "missing change-id error"
    

    solution:

    0.'git add .'
    
    1.save your HEAD commit change-id got from 'git log',it will be used later.
    
    2.copy the HEAD commit change-id from Gerrit website.
    
    3.'git reset HEAD'
    
    4.'git commit --amend' and copy the change-id from **Gerrit website** to the commit message in the last paragraph(replace previous change-id)
    
    5.'git push *' you can push successfully now but can not find the HEAD commit from **git log** on Gerrit website too
    
    6.'git reset HEAD'
    
    7.'git commit --amend' and copy the change-id from **git log**(we saved in step 1) to the commit message in the last paragraph(replace previous change-id)
    
    8.'git push *' you can find the HEAD commit from **git log** on Gerrit website,they have the same change-id
    
    9.done
    

提交回复
热议问题