3

I want to push a patchset to Gerrit which has already been pushed. Originally when the patches were sent up, the build system did not trigger. I need to trigger it again by resubmitting all patches.

Gerrit rejects this with

 ! [remote rejected] HEAD -> refs/for/branch (no new changes)

I know there are no new changes but I want to push anyway. How can I do this?

--force flag has no effect.

1 Answer 1

7

Execute "commit --amend, change the commit message and push again.

4
  • 1
    I have a lot of commits to push. Would rather not do this for each. Is there another way?
    – Fred
    Aug 7, 2018 at 17:26
  • You want to push just to trigger the build system? Are you using Jenkins + Gerrit Trigger plugin? Aug 7, 2018 at 18:53
  • 1
    Yes. I realized that I can just change commit message on the oldest commit and it will push all patches dependent on it as well. Thanks for your help!
    – Fred
    Aug 8, 2018 at 15:24
  • @SazzadHissainKhan Just find the oldest non-merged commit and run an interactive rebase "rebase -i <oldest_git_sha>~1" and change "pick" to "edit" on the oldest commit and continue. Then perform the command posted above by Marcelo and do "git rebase --continue" when done.
    – Fred
    Aug 21, 2020 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.