Apache Isis' source code is hosted in at GitHub (https, or ssh:
As you might imagine, only committers are permitted to push changes to the GitHub repo. As a contributor, we recommend that you fork the apache/isis GitHub repo, and then use your fork as a way of publishing your patches for the Apache Isis committers to apply.
The diagram below illustrates the process:
as a one-time activity, you fork the github.com/apache/isis repo into your own fork on github.com
as a one-time activity, you clone your fork to your local computer
you set the github.com/apache/isis as your upstream branch; this will allow you to keep your local clone up-to-date with new commits
note the asymmetry here: the
upstreamrepo (the Apache GitHub repo) is not the same as the
originrepo (your fork).
you work on your changes locally; when done, you push them to your GitHub fork
to contribute back a change, raise a JIRA ticket, and ensure your commit message is in the form:
ISIS-nnnn: …so that changes can be tracked (more discussion on this point below). In any case, before you decide to start hacking with Apache Isis, it’s always worth creating a ticket in JIRA and then have a discussion about it on the mailing lists.
Use GitHub to raise a pull request for your feature
An Apache Isis committer will review your change, and apply it if suitable.
If you choose to create your own fork then you’ll need an account on github.com. You then fork simply by pressing the "Fork" button:
An account isn’t needed if you just clone straight from the github.com/apache/isis.
Whether you’ve forked or not, you then need to clone the repo onto your computer. GitHub makes this very easy to do:
for Windows users, we suggest you use GitHub’s 'Clone in Windows' feature
for Mac/Linux users, create a clone from the command line:
Again, the info is easily found in the GitHub page:
If you’ve created your own fork, then you need to add the
upstream remote to the github.com/apache/isis.
This remote is traditionally called
You should then arrange for your
master branch to track the
upstream/master remote branch:
If you didn’t create your own fork, you can omit the above step. Either way around, you can now fetch new commits using simply:
Although with git your commits are always performed on your local repo, those commit messages become public when the patch is applied by an Apache Isis committer. You should take time to write a meaningful commit message that helps explain what the patch refers to; if you don’t then there’s a chance that your patch may be rejected and not applied. No-one likes hard work to go to waste!
We therefore recommend that your commit messages are as follows:
ISIS-999: Make the example in CONTRIBUTING imperative and concrete Without this patch applied the example commit message in the CONTRIBUTING document is not a concrete example. This is a problem because the contributor is left to imagine what the commit message should look like based on a description rather than an example. This patch fixes the problem by making the example concrete and imperative. The first line is a real life imperative statement with a ticket number from our issue tracker. The body describes the behavior without the patch, why this is a problem, and how the patch fixes the problem when applied.
If you are working without a GitHub fork of Apache Isis, then you can create the patches from your own local git repository.
As per this stackoverflow question, create the patch using
git format-patch -10 HEAD --stdout > 0001-last-10-commits.patch
-10 is the last 10 commits you have done.
You need to change that integer according to the commits you need to apply into the patch.
Assuming you’re development environment is all setup, let’s walk through how you might make contribute a patch. In this example, suppose that you’ve decided to work on JIRA ticket #123, an enhancement to support Blob/Clob datatypes.
The first thing to do is to make sure your local clone is up-to-date. We do this by retrieving new commits from upstream repo and then merging them as a fast-forward into your local branch.
Irrespective of whether you are using a GitHub fork, the upstream for your local
master branch will be tracking the appropriate remote’s
So n either case, the same commands work:
Alternatively, you can combine the
git fetch and
git merge and just use
git checkout master git pull --ff-only
pull fails, it means that you must have made commits and there have been changes meanwhile on the remote
You can use `gitk --all to confirm.
If this fails, see our git cookbook page for a procedure to retrospectively sort out this situation.
We recommend you name topic branches by the JIRA ticket, ie <tt>ISIS-nnn-description</tt>.
So let’s create a new branch based off
master and call it "ISIS-123-blobs"
You can confirm the branch is there and is your new
HEAD using either
Alternatively, use the command line:
$ git checkout -b ISIS-123-blobs
The command line prompt should also indicate you are on a branch, isolated from any changes that might happen on the
Next, make changes to your files using the usual commands (see also our git cookbook section):
and so on.
Continue this way until happy with the change.
Remember to run all your tests on the topic branch (including a full
mvn clean install).
Before you can share your change, you should rebase (in other words replay) your changes on top of the
The first thing to do is to pull down any changes made in upstream remote’s
master since you started your topic branch:
These are the same commands that you would have run before you created your topic branch.
If you use
gitk --all, there’s a good chance that new commits have come in.
Next, we reintegrate our topic branch by rebasing onto
git checkout ISIS-123-blobs git rebase master
This takes all of the commits in your branch, and applies them on top of the new
When your change is eventually integrated back in, it will result in a nice clear linear history on the public repo.
If the rebase fails because of a conflict, then you’ll be dumped into REBASE mode. Edit the file that has the conflict, and make the appropriate edits. Once done:
Once the rebase has completed, re-run your tests to confirm that everything is still good.
If you have your own fork, you can now simply push the changes you’ve made locally to your fork:
This will create a corresponding branch in the remote GitHub repo.
If you use
gitk --all, you’ll also see a
Then, use GitHub to raise a pull request. Pull requests sent to the Apache GitHub repositories will forward a pull request e-mail to the dev mailing list. You’ll probably want to sign up to the dev mailing list first before issuing your first pull request (though that isn’t mandatory).
The process to raise the pull request, broadly speaking:
Open a web browser to your GitHub fork of isis
Select your topic branch (pushed in the previous step) so that the pull request references the topic branch.
Check that the Apache Isis mailing list email came through.
To double check that your pull request is accepted, update your
master branch from the
You can then use
gitk --all (or
git log if you prefer the command line) to check your contribution has been added.
You can now delete your topic branch and remove the branch in your GitHub:
Finally, you might want to push the latest changes in master back up to your GitHub fork. If so, use:
If your pull request is rejected, then you’ll need to update your branch from the main repository and then address the rejection reason.
You’ll probably also want to remove the remote branch on github:
git push origin --delete ISIS-123-blobs
... and continue as before until you are ready to resubmit your change.