Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gerrit: push: no changes between prior commit and new commit. Not able to pull changes

Tags:

git

gerrit

i try to push my new patch sets of my already made commits. I use the command

git push origin HEAD:refs/for/master

But now i have the problem, that an already pushed commit was rebased from an other gerrit user using the gerrit webinterface. So gerrit is telling me:

No changes between prior commit xxxx and new commit xxxx

Now i thougt i had to pull the rebased patch set to solve that issue. But if i try to

git fetch master

or

git pull

git tells me:

Already up-to-date

so I'm not able to pull the rebased patch set.. Can someone help?

like image 690
Ventu Avatar asked Feb 27 '15 10:02

Ventu


People also ask

How do I add a topic on Gerrit?

It is also possible to set a topic on push, either by appending %topic=… ​ to the ref name or through the use of the command line flag --push-option , aliased to -o , followed by topic=… ​ . Gerrit may be configured to submit all changes in a topic together with a single click, even when topics span multiple projects.


1 Answers

Since you're pushing a new patch set in gerrit, the changes should be on top of the existing commit SHA hash.

Since the rebased commit is local to gerrit (also, probably to the user who rebased it) and has not been submitted to master, you can't directly fetch/pull from master as it does not exists in the remote branch.

You need to fetch the commit from gerrit to your local repo using the gerrit URL and then merging/rebasing your local repo. The gerrit refspec should have the following format.

git fetch <Gerrit URL> <refs/changes/<change id>/<gerrit id>/<patch set #>>

This git push issue is also reported when we cherry-pick a commit, which applies the changes introduced by some existing commit but creates a new SHA hash, and we try to push changes on top of this new local commit.

like image 135
Ravi Avatar answered Oct 11 '22 01:10

Ravi