Developing and Submitting a Patch

We use GitHub to manage our source code. MOTECH org members are able to create branches and commit changes to the MOTECH code repositories. Community members utilize the fork and pull GitHub workflow.

Community Member Development Workflow

This is the most straightforward way to submit a patch as a community member. Note that GitHub allows you to submit only one pull request per branch at a time. If you wish to work on multiple features at once, it’s best to create a branch for each feature and create a pull request from that branch to our repository.

  1. Fork the MOTECH repository you wish to develop

  2. Clone your fork on your development machine

  3. Add an upstream branch to your fork for easy syncing

  4. Checkout a new feature branch

    git checkout -b newfeature
  5. Make changes/test/multiple commits

  6. When ready to submit changes: update master from upstream, squash commits and merge the feature branch

    git checkout master
    git fetch upstream
    git merge upstream/master
    #This merge is optional because you can push your local branch to your fork and create a pull request from there
    git merge --squash newfeature
    git gui
  7. Edit commit message using the proper commit message format

  8. Push changes

    git push origin
  9. Submit a pull request from your fork to the motech repo.

Submitting Changes to Incorporate Review Comments

Our team will review your pull request in GitHub. If you received feedback during this process, GitHub allows you to add commits to your pull request. Just commit your changes and the pull request will automatically update.