Last updated March 2, 2015. Created on June 8, 2005.
Edited by hansfn, elissmith, sachin00700, leelavasundaradk. Log in to edit this page.

What is Drupal Documentation?

Members of the Drupal community can write and edit all sorts of Drupal documentation:

Why contribute

You can be part of this effort! By writing and reviewing documentation, you will:

  • Learn more about Drupal
  • Share your knowledge with other Drupalists
  • Gain experience in technical writing and editing, with friendly mentoring
  • Build your reputation
  • Help the Drupal open-source community by improving the documentation

... and there are many other reasons people write free documentation.

Who can contribute

Anyone can contribute to Drupal documentation. We especially welcome the contributions of Drupal beginners. In fact, beginners have a distinct advantage over the experts, because they can more easily spot the places where documentation is lacking.

How to contribute

To find a documentation task to work on, browse through the New contributor tasks page, especially the 'Anyone' and 'Writers' sections, and find tasks in each that are related to Drupal documentation. The tasks are written up with detailed instructions and links to background material.

If you're already familiar with the procedures, check out the Current Priorities page to learn about the immediate documentation writing and editing priorities of the documentation team.

You can also read the Contributing to documentation FAQ.

This page documents a high-level overview of the current best practice recommendations for contributing change requests, in the form of a patch file, to projects (e.g., modules, themes, Drupal core, etc) hosted on Drupal.org using Git. For a more advanced workflow with Git, please refer to the Advanced patch contributor guide. Drush issue queue commands makes it easier and faster to create and work with patches.

Note 1: If you're unfamiliar with patching Drupal, please read the Getting Involved section on Patches.

Note 2: If you choose to create patches with a tool other than Git, be sure to produce a -p1 patch; the old -p0 format was phased out in 2011

There is a short video on Applying and Creating Patches with Git that covers much of this material as well.

Quick and simple patch

This section is written to be a step-by-step guide to help someone contribute their first patch.

  • Go to the module or theme's page. ex: http://drupal.org/project/colorbox
  • Click "Version Control" under the title. ex: http://drupal.org/project/colorbox/git-instructions
  • Select the dev version that you wish to patch/update. This is typically the current Drupal release with the module's version and '-dev' appended. ex: 7.x-1.x-dev. Make patches against the -dev version because it is the latest code. Note that when you're working on the -dev branch with git, you won't actually append '-dev' to the branch name or see '-dev' in the branch name. Just the fact that the branch name ends in '.x' (e.g. 7.x-1.x) means it is a development branch. Any changes since the last release, 7.x-1.2, will already be in the -dev branch.

  • Click the show button to make sure the "git clone" command line is correct/updated
    Copy the "git clone --branch .. " command
  • Now run the git command to download a revisioned copy of the module or theme. Run the command in the appropriate folder (ex: sites/all/modules or sites/all/themes) and it will be the equivalent of downloading and unpacking the module or theme, but with git revisioning.
  • git clone --branch 7.x-1.x http://git.drupal.org/project/colorbox.git
    cd colorbox
  • In the module or theme directory, tell git to create a 'branch' of the local version you just downloaded so that you can update/change a separate branch, commit those changes, and still easily generate a patch against a local branch.
  • git branch [issue-number]-[issue-description]
    ex: git branch 1234-fix-for-header
    To see if it worked:

    git branch
    * 7.x-1.x
    1234-fix-for-header
    Notice the '*', it tells which branch git is using. To use the new branch, tell git to checkout the files from branch 1234-fix-for-header. Note: 'git checkout branch-name' replaces all of the revision-ed files in the directory with the files from that branch, essentially swapping out one version for another. In our case, the files are the same so there isn't any noticeable change. (To quickly fill in the branch-name, start typing and hit 'tab'.)
    git checkout 1234-fix-for-header
    git branch
    7.x-1.x
    * 1234-fix-for-header
    Now make the changes you want to the modules or themes. You can use git to see about general changes you've made, specific changes you made, add files you created, and commit your work.

  • git status
  • git diff
  • git add new_file.php
  • git commit -a
  • When you're ready to make a patch. Go to the folder of the module or theme. Commit any changes you've made, then use 'git diff 7.x-1.x' to review the changes that will go into the patch.

  • git diff 7.x-1.x
  • (To exit git diff, simply press q.)

    When you're ready, create the patch with this command:

    git diff 7.x-1.x > [project_name]-[short-description]-[issue-number]-[comment-number].patch

    Now go upload the patch! congratulations on helping to make Drupal better!

    Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.