Developing your codebase

Managing your PaaS subscription

After you prepare your Acquia Cloud Site Factory development environment, use the information on this page to help you develop your website's features.

Based on the branch-per-feature model, you should create branches for each of the features that you want to develop. All of these branches are based on the master branch from your code repository.

Creating a feature branch

To set up a feature branch:

  1. Open a command prompt window, and then change the directory to the location that contains the clone of your code repository.
  2. Switch to the master branch.

    git checkout master
    git pull origin master
  3. Create the feature branch, and then switch to the new branch using the following commands (where [feature_id] is the name of your feature branch):

    git checkout -b [feature_id]
    git push origin [feature_id]

    Be sure to create each branch using a descriptive name that relates to the code that it contains.

Create and use as many feature branches as needed to keep your development efforts separate from one another.

Where do I put my code?

As you develop each code branch, place code changes and additions only in the docroot/sites/all/* folders as exemplified in the following:

  • docroot/sites/all/modules
  • docroot/sites/all/modules/custom (Suggested location for custom modules)
  • docroot/sites/all/modules/contrib (Suggested location for modules from Drupal.org)
  • docroot/sites/all/themes
  • docroot/sites/all/libraries

Committing branch changes

Whenever you want to commit your changes back to the code repository for the branch that you're working on, run the following command to commit the change locally:

git commit -a -m "Comment"

After you commit the change, send the change to the code repository (where [feature_id] is the name of your feature branch):

git pull origin [feature_id]
git push origin [feature_id]

Additional information

As you are working with your code, if you need to run a Drush command that only affects one of your websites, be sure to use the --uri=site.host.com parameter, where site.host.com is your website's complete site and domain name.

For additional information about developing your codebase, including platform restrictions, see Maintaining your PaaS codebase.

Next step

Whenever you have finished developing feature branches for your websites and you want to ensure that they work correctly, you can integrate and test your feature branches on copies of your websites hosted on your development or staging environments.

Contact supportStill need assistance? Contact Acquia Support