Made changes to a commit, performed commit amend. Do a push and I get the error:
! [remote rejected] master -> refs/for/master (no changes made)
My simple solution is, to update project and then commit and push.
This help, becouse the master and your local branch are inconsistense. This can be, when you maybe rebase on gerrit...
This issue is due to the actions I'd performed previously. I was trying to push
a new change, on top of a change which was still up for review, who's parent also was up for review.
Trunk ------ Parent A ----- Parent B ----- New change
(merged) (unmerged) (unmerged)
I had used cherry-pick
to obtain these two changes locally (Parent A and Parent B), and then a third cherry-pick
to get my change from a local branch before attempting to push
. That is what caused the issue, because my personal change was essentially trying to re-write history.
The correct process would be to only pull
Parent B when at trunk. This automatically pulls up any commits between trunk and it (in this case just Parent A). Then cherry-pick
my new change on top of that and push
will work fine.
It sounds like you are doing everything correctly as far as verifying you have made a change that Gerrit should pick up.
git push origin master:refs/for/master
Maybe this is the problem? If your changes aren't on your local version of the master branch, you aren't pushing your changes. Instead try:
git push origin HEAD:refs/for/master
HEAD
is a shortcut that represents your current commit in git.