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.

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
Fred
  • 53
  • 1
  • 11

1 Answers1

7

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

  • 1
    I have a lot of commits to push. Would rather not do this for each. Is there another way? – Fred Aug 07 '18 at 17:26
  • You want to push just to trigger the build system? Are you using Jenkins + Gerrit Trigger plugin? – Marcelo Ávila de Oliveira Aug 07 '18 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 08 '18 at 15:24
  • @SazzadHissainKhan Just find the oldest non-merged commit and run an interactive rebase "rebase -i ~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 '20 at 18:11