Reputation: 16597
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)
Checked the change ID in the commit message and its still a valid commit.
I've tried changing a file, checking it shows up as an alteration and then added to staging area and done another commit amend. Try the push again and getting the same issue. No idea on this one.
Edit: This is pushing to gerrit, not git directly.
I'm running:
git push origin master:refs/for/master
And the result of getting the details of origin are (with company details edited out):
$ git remote show origin
* remote origin
Fetch URL: ssh://[email protected]:29418/myrepo
Push URL: ssh://[email protected]:29418/myrepo
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master rebases onto remote master
Local ref configured for 'git push':
master pushes to master (up to date)
Upvotes: 45
Views: 80932
Reputation: 21
As others has pointed out that it is due to and abended review request. Same change id has been assigned to your commit.
My issue got resolved when I amended the commit git commit --amend and then removed the change id. After saving the a new change it was assingned to my commit and I was able to create the gerrit review.
Below comment is from one of the google groups
"If you amend the change and put a new Change-id it will work. I think this makes sense since the abandoned change is still around in Gerrit, so it has no other chance than requiring a new change-id otherwise it couldn't distinguish between the old abandoned change and the new one meant for the master branch."
Upvotes: 0
Reputation: 1548
I got this error when I pushed with a
git commit -m "updated message"
and forgot the to include --amend
git commit --amend -m "updated message"
Upvotes: 1
Reputation: 1
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...
Upvotes: -2
Reputation: 59
i had the same issue. Just changed the commit message and pushed the code. It was successful.
Upvotes: 2
Reputation: 3228
Please refer to the official documentation on this issue here:
https://gerrit-review.googlesource.com/Documentation/error-no-new-changes.html
I had the same issue, my issue was that I pushed the change, then abandoned that merge, then I made a few tweaks, wrongfully amended my commit and pushed again. That is where I got the error.
My fix:
git commit --amend
, remove the existing change-Id
, assuming you have the git hooks set up, you can finish the commit and a new change-Id
should be assigned to you. change-Id
, figure out what is going on, and fix accordingly. (recommended) Upvotes: 10
Reputation: 145
With this error message Gerrit rejects to push a commit as a new patch set for a change, if the pushed commit is identical to the current patch set of this change.
A pushed commit is considered to be identical to the current patch set if
are all identical.
Upvotes: 0
Reputation: 16597
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.
Upvotes: 52
Reputation: 17933
I had the same error message, but the changes I was trying to push were on top of different commits from the original Change set (did some magic tricks with git cherry-pick
and it seems gerrit did not like it). I abandoned my original change, then reopened it when I realized I could fix the issue, but failed to send to gerrit with git review
.
At this point, my quick solution was to abandon the original change from gerrit website, and create a new change by removing the change-Id: sha1
last line from the commit message with git commit --amend
.
Upvotes: 0
Reputation: 76
I had the same issue. At the same time there was another commit not merged to master and was in gerrit review and rebased in gerrit. i.e. code pushed for review. rebased in gerrit and review pending to finish. Once the code was reviewed I was able to push without error.
Upvotes: 0
Reputation: 7491
If you are trying to update a set of reviews, each with their own change-id that you want to maintain (say, after a rebase where you swap the order of two commits), you might get rejected if some of the commits in the pile remain unchanged. You should force a new hash to be generated by rewording the commits, or something similar.
Upvotes: 3
Reputation: 5532
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.
Upvotes: 1