Development/Git

From MusicBrainz Wiki
Jump to navigationJump to search

Development > Git

Development on the MusicBrainz Server source code is coordinated using Git. The Git web interface, http://git.musicbrainz.org, provides access to viewing the various repositories and even browsing the source code.

Checking out source code

To create a local copy of the MusicBrainz Server source code, clone the repository using:

git clone git://git.musicbrainz.org/musicbrainz-server/core.git mb_server

And to stay up to date with the latest changes use:

git pull

The above will clone the latest stable development version. Alternatively, if you're looking for a stable live release of the MusicBrainz Server, all official releases we make are tagged and accessible using:

tag -l
git checkout <tag name>

If you need help or are confused send an email to support@musicbrainz.org, or drop by the #musicbrainz IRC channel.

Development with Git

If you want to help contribute to MusicBrainz - it's really simple! All you need to do is branch off master and commit there:

git clone git://git.musicbrainz.org/musicbrainz-server/core.git mb_server
cd mb_server
git checkout -b my-cool-feature master

When you are ready to share your work with us you have a few options - if you wish to submit a patches, you should use git format-patch. These can then be emailed to the developers mailing list. If you're doing work on more than one branch, or you'd like to have more control, we are happy to give you a branch or repository on git.musicbrainz.org to push work to. For more information on this, please ask on the developers mailing list and someone will give you more details.

If you have write access to a repository on git.musicbrainz.org, this process changes slightly. Instead of cloning from git://, you should use the following:

git clone ssh://mbgitrw@git.musicbrainz.org:10015/musicbrainz-server/core.git mb_server

Notice the ssh username, and the non-standard port, 10015.

Submitting a patch

To submit a patch using "git format-patch", make sure you're on the correct feature branch. Then call git format-patch with the name of the branch you branched off from:

 $ git checkout my-cool-feature
 $ git format-patch master
 0001-my-feature-is-cool.patch

It should create one or more patch files. Attach those to a mail to the developers mailing list and one of the developers with access to the git repository will apply it for you. Please reference the jira ticket number in the subject if you are fixing a known bug. Also, if possible, submit a review to http://codereview.musicbrainz.org before mailing to the mailinglist, so we can more easily give feedback on your patch.

Git Resources

If you're new to Git, don't worry - there is plenty of excellent documentation about how to use it: