Reputation: 1471
I made some changes, committed them and pushed the branch to Gerrit (git push gerrit
). Now my changes don't appear in Gerrit and I assume this is because I pushed the changes manually instead of using git review. When I run git review
now, Im getting this error:
remote: Processing changes: refs: 1, done
To ssh://user@gerrit-host:29418/Project
! [remote rejected] HEAD -> refs/publish/master (no new changes)
error: failed to push some refs to 'ssh://user@gerrit-host:29418/Project'
How can I tell Gerrit that my changeset needs to be reviewed?
Upvotes: 11
Views: 31653
Reputation: 541
git commit --amend
can't resolve several commits, only can push last one to gerrit.
Another resolution is to checkout and use cherry-pick commitid1 commitid2 commitid3
, then push.
Upvotes: 0
Reputation: 1
To avoid this error
! [remote rejected] HEAD -> refs/for/develop (no new changes)
Just follow these steps
git commit --amend # this will create a new patch
git push gerrit HEAD:refs/for/your_branch
Upvotes: -2
Reputation: 1326
you can remove that commit from remote branch or you can do this
git commit --amend
this will create a new patch
git push gerrit HEAD:refs/for/your_branch
Upvotes: 8
Reputation: 4967
I've found that git review
will not submit a branch with no changes. It's basically saying: "since there are no changes in your commit there's no reason to submit... so I won't". Unlike your situation, this has happened to me when there was an error in the previous push.
What I've done in these cases is simply add a minor change (such as adding a blank line) so that gerrit see things as different and then it works.
Another thing you could do (depending on the process your organization uses) is to remove the Change-Id from your change log (using git commit --amend
) and then run git review
, thus creating a new review set, essentially staring over as far as Gerrit is concerned.
Upvotes: 0