1.1 Overview
You can manage your development workflow using git in any number of ways. This workflow is just one option.
It is based on organising your repo branches into two groups: the lifetime branches and the transient branches.
1.1.1 Two infinite lifetime branches
- master - production ready at all times
- stage - stage features, fixes for production
1.1.2 Three transient branches
- features, release, hotfix
- lifetime limited to relevant tasks
- history is preserved
This workflow is based on: Git - Drupal 7 Workflow (Matthew Steele)
1.2 Get Started
1.2.1 Checkout Master branch
Check available branches
git branch
Checkout master (if you are anywhere else, like maybe a detatched master.)
git checkout master
1.2.2 Create the Stage branch
To create a branch and switch to it at the same time, you can run the git checkout
command with the -b
switch
git checkout -b stage
Add the stage branch to github repo for other developer to access
git push origin stage
Now you have a master branch which is in production and you have a stage branch which is the main backbone of development.