Development/Git

From MusicBrainz Wiki
< Development
Revision as of 21:11, 18 October 2010 by PavanChander (talk | contribs) (core.git has been renamed)
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.git musicbrainz-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:

git 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.git musicbrainz-server
cd musicbrainz-server
git checkout -b my-cool-feature master

This will give you a local branch to work on your feature. Note, this is a slightly different model than you may be used to. This type of development is called "topical branches" - each branch of the code deals with a single isolated feature. This helps us develop by reviewing individual features and bug fixes, without being confused by other possibly unimportant changes.

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.git musicbrainz-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. Call git format-patch with the name of the branch you branched off from, like this:

 $ 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. If possible, submit a review to http://codereview.musicbrainz.org before sending us mail, so we can more easily give feedback on your patch.

Please add [PATCH] to the subject line, and reference the jira ticket number if you are fixing a known bug. A subject line should look like this:

 Subject: [PATCH] MBS-123: Added support for My Cool Feature

Git Resources

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