Contributing Code to Formhub - SEL-Columbia/formhub GitHub Wiki
Contributing Code
Use Test Driven Development
- any new code must have new tests for all new functionality
- it is more efficient to use Test Driven Development
- write tests before, or as, writing new functionality
- info on TDD
Using git to create a new branch
- get remote code from the server
- clone the master branch for the latest stable version
- if you have already cloned, pull the latest code
git pull origin master
- pull from the
master
branch
- create a new branch for your changes, we will call it 'new-version'
git checkout -b new-version
- check if something on your computer does not match remote
- show changes to code
- saving changed code as finished
git commit file.py -m "[message for file]"
- putting changed code on the server
git push origin new-version
Using git to work on an existing branch
- viewing local branches
- viewing all branches
- checking out another branch
git checkout -t new-version
- get remote code for 'new-version'
git pull origin new-version
Running Tests
- your branch must pass all tests before it will be merged
Submit a pull request for your new branch
- go to github and create a pull request