Git

This page is part of the Developer Section. It describes how to use git to manage the BaseX sources.

Using Git to contribute to BaseX
Our team uses git and GitHub to manage the source code. All team members have read/write access to the repository, and external contributors are welcome to fork the project.

Git makes it easy to retain a full copy of the repository for yourself. To get started and running, simply fork BaseX:


 * 1) Head over to https://github.com and create an account
 * 2) Fork https://github.com/BaseXdb/basex, so you have a version on your own
 * 3) The forked project can then be cloned on your local machine, and changes can be pushed back to your remote repository

Developing a new feature or bug fix
It is always a good idea to create a new branch for a new feature or a big fix you are working on. So first, let's make sure you have the most up-to-date source code. We assume, that you added BaseX as upstream repository as described above and you are currently in the master branch:

 $ git pull upstream master

Now, we create a new branch, based on the master branch

 $ git checkout -b new-feature Switched to a new branch 'new-feature'

Your are now automatically switched to the new-feature branch. Now you can make all your changes in one or several commits. You can commit all changes using

 $ git commit -a

Now, you want to push these changes to the repository on GitHub. Remember, that up to now your changes just reside on your local drive, so now you want to push it to your remote fork of BaseX. Simply do:

 $ git push origin new-feature Counting objects: 318, done. Delta compression using up to 4 threads. Compressing objects: 100% (107/107), done. Writing objects: 100% (154/154), 22.96 KiB | 0 bytes/s, done. Total 154 (delta 93), reused 81 (delta 26) To git@github.com:$username/basex.git * [new branch]     new-feature -> new-feature

You can now use your web browser and go to your fork of BaseX. You will see the following message:



You can now click the "Compare & pull request" button. You can now review the changes you are going to push.

'''Please review them carefully. Also, please give a meaningful comment so we can quickly determine what your changes are doing.''' After clicking the "Create Pull request" button you are done and we will review your changes and either merge the pull request or get back to you.

Links

 * GitHub: git Installation Guide
 * Comprehensive Getting Starting Guide on GitHub
 * The git book
 * Gitcasts.com – Video Guides