We all push and pull from master branch. Code changes should only be pushed to github if all tests are green.
Below is a common workflow for a team working with a central repo. several variations are possible, but if unsure, please go by this:
- if you are working from a Pivotal Tracker story, click "start" on that story
- git pull
- rake db:migrate
- rake db:test:prepare
- spec spec
- cucumber (if we are using it)
- if either are not green, stop here and investigate. do not continue to develop until all green.
- git checkout -b my_work (create and switch to a local branch where you'll do your work, it's a good practice to give a name to your local branch, that relates to the PT story)
- do a little coding
- make sure the tests are passing
- git add . (or add selectively)
- git commit -m "[#NNNNNNN] bla bla" (where NNNNNN is the PT story id)
- repeat steps 7, 8 and 9 as many times as you wish
- git checkout master
- git pull origin master (you do this at this step in case someone else pushed while you were working)
- if that git pull says 'Already up-to-date', proceed to step 20,
- run tests again
- git checkout my_work
- git rebase master
- git checkout master
- git merge my_work
- git push origin master
- if you're working from Pivotal Tracker, click "finish" and then "deliver" on the story you just completed