Login | Register
My pages Projects Community openCollabNet

Wiki: Using GIT and Gerrit

2020-04-07: This site is going to be decommissioned and shut down on 2020-07-01. Please copy and archive any data you wish to keep before that date.

Revision 12 as of 2013-01-08 05:59:05 -0700

Edit this page | Links to this page | Page information | Attachments | Refresh page


It is now also possible to contribute to the argouml projects through Gerrit. This also means that you will be using git instead of subversion so it is also an option for those that prefer git. This approach has some ?pros and cons.

Here is a short introduction on how to do it:

  1. Register on the Gerrit server and create your Gerrit user, set-up your email, register your public ssh-key with this user. (One time only.)

  2. Clone the git repository git clone ssh://your_gerrit_user@argouml-jenkins1.dyndns.org:29418/project project, and cd project. (One time per machine you are working on. This takes more than 3 minutes and uses 320Meg for the main argouml project.). For more work using the same machine, you can pull down updates using git pull and git rebase origin/trunk.

  3. Create a local git branch for your work and switch to it git branch work, git checkout work.

  4. Do your work.
  5. Run the tests (mvn test, mvn exec:java, ...)

  6. Check into your git repository using a single commit git add ..., git commit -m'Message' if needed followed by a sequence of commit amends git commit --amend.

  7. Push your Patch Set to the Gerrit server for review git push origin HEAD:refs/for/trunk. This will fail and suggest a Change-Id if you havn't provided on.

  8. After your commit, you will get mails from the Gerrit server with information on the Continuous Integration job and other review comments. Monitor the Gerrit server to take part in any discussion of your changes.
  9. If you need to push an updated Patch Set to replace the previous Patch Set commit using git commit --amend and push again git push origin HEAD:refs/for/trunk. This relies on the Change-Id in the commit message to identify the change. The Gerrit server will pick up on the Change-Id and treat this as a replacement Patch Set.

  10. When a Gerrit Approver has approved your change, it is automatically checked into the subversion repository.

Syntax of commit message

Short sentence
<empty line>
Full explanation