blob: 18bf7a61ff0836246334ac804b1ed69cbb74cb2e [file] [log] [blame]
== Push a Change to Gerrit
In this exercise you will learn how to push a change to the Gerrit
code review system.
=== Preparation
* Make sure you configured the push to Gerrit in your local Git
repository as described in the exercise
link:configure-push-to-gerrit.html[Configure Push to Gerrit].
* Create a new local branch starting from the 'origin/master' branch
and create one new commit in that branch. Make sure the
'Compute Change-Id for Gerrit Code Review' button in the commit
dialog is selected when you commit the changes. This will create
the 'Change-Id: ...' footer in the commit message which is necessary
for the Gerrit Code Review.
+
image:commit-changes-with-changeid.png[Commit Changes with Change-Id]
+
'I0000000000000000000000000000000000000000' is just a placeholder for
the Change-Id. The actual Change-Id will be generated and inserted on
commit.
+
image:history-view.png[History View]
=== Pushing to Gerrit
Right click the Git repository node in the Git Repositories view and
chose the 'Push to Upstream' command from the context menu:
image:push-to-upstream.png[Push to Upstream]
If you are pushing over HTTP you are asked to provide user and
password (if not configured already):
image:http-login.png[HTTP Login]
After the change is pushed the confirmation dialog will appear:
image:push-confirmation.png[Push Confirmation]
From the confirmation dialog we see the URL under which the change is
exposed in Gerrit. We also see that the numerical ID of the change is
'41480' in this case.
=== Check your Change in Gerrit
* Copy the link from the confirmation dialog to the clipboard and
paste into you web browser
+
image:change-in-gerrit.png[Change in Gerrit]
* *OR* simply open
link:https://gerrit-review.googlesource.com/#/q/status:open,n,z[Gerrit] in
your web browser and find your change in the list of open changes.
Usually, it is the one on the top as the entries are sorted by time
of last update. Click on the change to get to the change details.
+
image:change-in-gerrit-2.png[Change in Gerrit]
* Get familiar with the information Gerrit displays on the change
page. The change contains one patch set on its creation. A patch set
corresponds to one Git commit.
* Click on a file to see the Side-by-Side diff.
'Q:' Compare the local commit SHA1 and the SHA1 of the Patch Set 1.
Are they the same?
link:index.html[Gerrit Exercises]