Collaborative Development on GitHub

To work on the Drupal Commerce code in development, you should begin by signing up for a free Open Source account:

Browse to http://github.com/plans and click the Sign Up! button picture above. While registering you can go ahead and enter your public SSH key (if you have one):

GitHub will use this when you clone and push changes to your repositories. If you aren't sure what SSH keys are or how to generate them, refer to GitHub's article Generating SSH keys.

Once you're logged in, you'll want to browse to the main Drupal Commerce repository. The top sections of the content area will let you navigate to different information pages, find the URL to clone the repository, and view the most recent commit:

Below these sections you can view the contents of the repository and navigate through the module folders. You can also quickly browse the source code through the browse by clicking on any file.

If you want to clone the main repository's code to work with locally, you'll use the public URL as shown above. However, you might want to work with code in progress in someone else's fork. To view those, you should click the Network tab at the top of the content area pictured above. The graph shows the development of various forks of the Drupal Commerce repository. You can switch to any fork you want by clicking on the user's name in the fork chart. To clone someone else's work, click the Source tab after navigating to their fork and get their public URL.

When you're ready to start working with the core code yourself, you should fork the main repository. (You may then want to merge from another developer's fork of the main repository to collaborate with his or her development in progress.) GitHub makes forking easy by providing a simple button at the top of the repository page:

Clicking the Fork button will create a new forked repository on GitHub under your user account. You should be automatically redirected to the new repository page. The header area will show where your forked from:

The buttons on the right will also be updated to include an Admin button you can use to adjust the settings for the repository. (We'll cover the other buttons in a bit.)

To start developing with your new repository, you'll need to clone it to your local machine. If you look at the URL bar we pictured above, you'll see it has a new Private option. This displays the URL you can use to both read from and write to the repository:

Once you've cloned the repository to your development machine, you can start to modify the code and make commits to your local repository. You can push changes upstream to your GitHub repository. (We'll have a separate page up on how to use Git in general for maintaining a repository.)

When you have code you want someone else to merge into their development branch or a Drupal Commerce maintainer to consider for inclusion in the main repository, you'll use GitHub to submit a Pull Request by clicking the button in the header (pictured above). This will bring up a modal dialog for you to fill out:

Enter a description of the changes in your repository so the person you target with the request knows what's been updated. The people you send a pull request to will be able to view a diff as well, and upon review can then pull your changes into their repository. When a maintainer pulls code from a fork into the main Drupal Commerce repository, the commit will be mirrored to CVS on drupal.org so the code will be up to date there.