Skip to content

Contributing Code

Andrea Boriero edited this page Feb 19, 2020 · 5 revisions

Intended mainly as a guide for folks that want to contribute that may not be familiar with Git and/or GitHub, although covers some specific "Hibernate way" stuff as well.

JIRA issue

First thing is to make sure there is a JIRA issue that covers the changes you propose. If not, create one. The Hibernate JIRA is hosted at https://hibernate.atlassian.net

Fork the repo

See http://help.github.com/fork-a-repo for details.

Completely new to Git? You may also want to check out these resources first:

Clone your fork

GitHub will prompt your with the steps to clone your fork after you have created the fork. If not, all you need is the URL which is displayed on the main repository page.

Create the working (topic) branch

Create a "topic" branch on which you will work. The convention is to name the branch using the JIRA issue key (HHH-123, for example). Assuming you will be working from master: git checkout -b <key> master

Code!

Do yo thang

Remember to import in your IDE https://github.com/hibernate/hibernate-ide-codestyles so that you can follow consistent formatting and style conventions with every other contributor.

Commit

Commit the changes. Be sure to use the JIRA issue key in the commit message.

Prior to committing, if you want to pull in the latest upstream changes (highly appreciated btw), please use rebasing rather than merging. Merging creates "merge commits" that really muck up the project timeline.

Push

This is pushing the changes to your fork of the upstream repo. Assuming the GitHub remote to your fork is named origin (which is the Git default on clone, although most people change these around based on personal taste): git push origin HHH-123

Initiate the pull request

See http://help.github.com/send-pull-requests/ for details. After the pull request has been sent, add its URL to the JIRA as a comment.

Be sure to see https://github.com/hibernate/hibernate-orm/wiki/Jira-Report-Expectations#in-general for a discussion of what to expect.

Profit!