gitgerritgit-review

git-review -> promote draft to code-review


I have created a Gerrit draft:

git review -D

Once I am done working on the draft, how do I create the code-review so it can eventually be merged to master?

If I just do:

git-review

I get this output:

$ git review
remote:
remote: Processing changes: refs: 1, done
To ssh://jonbri@gerrit-foo.com:29418/fooProject
 ! [remote rejected] HEAD -> refs/publish/master/p-jonbri-gitReviewBranch (no new changes)
error: failed to push some refs to 'ssh://jonbri@gerrit-foo.com:29418/fooProject'

Solution

  • There are two possibilities to publish a draft change:

    1. Web UI: Open the draft change and use the "Publish"-button.
    2. Command line: Use the Gerrit REST API with a client like curl: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#publish-draft-change