Skip to content
Tim Wood edited this page Mar 5, 2016 · 23 revisions

Getting started developing in this project

Master branch will only contain merge branches that have been tagged Master. Should always work and "be pristine".

Git process overview and rules

Create develop branch, and then a feature branch to do the work Pull requests are made against develop When develop gets to a state we want to commit, we tag and push to master

no commits directly to master or develop - all done as pull requests develop gets updated via pull requests master gets it updates from develop

How to setup your local environment

  • Fork the canonical repo from https://github.com/Drupal4Gov/Drupal-GovCon-2016
  • Git clone your fork locally
    cd ~/Sites ; git clone git@github.com:[your-github-username]/Drupal-GovCon-2016.git; cd Drupal-GovCon-2016
  • Configure the canonical repo as an upstream remote
    git remote add upstream git@github.com:Drupal4Gov/Drupal-GovCon-2016.git
  • Configure Acquia as another, push-only, remote source
    git remote add acquia DONTFETCH-ONLYPUSH
    git remote set-url --push acquia capitalcamp@svn-6971.prod.hosting.acquia.com:capitalcamp.git
  • If you don't have access to Acquia remote, contact someone in #website on slack
  • From here you can install Drupal and start developing with Drupal VM or Acquia Dev Desktop or whatever you like

Git development steps

  • Each time you are starting work, pull from the canonical drupal-gov-con develop branch to your local develop branch
    git fetch upstream; git checkout develop; git merge upstream/develop
  • Create a feature branch to work in (git flow is an excellent set of extensions/commands for managing branches), each feature branch should be titled "issue-n-feature-name" based on an issue from the canonical Github project
  • [Optional - one time] Initialize git flow
    git checkout -b master origin/master; git checkout develop ; git flow init -d
  • Create feature branch with git flow
    git flow feature start [featureName]
  • Do your work in Drupal and export anything to code
  • Stage and commit changes to your feature branch in small, incremental, meaningful commits with helpful commit messages
  • When finished with your feature:
  • push your feature branch to your forked repo
    git push origin [featureName] (OR git flow feature publish [featureName]if you are using git flow)
  • create a pull request against drupal-gov-con develop branch (more on pull requests)
  • review and merge in github OR review and merge locally

Remember, each time you create a feature branch, make it from a fresh pull of develop