Working with task branches
When a new task arrives, developer needs to start his job by creating a task branch:
- In order to improve branch description, prefix the branch name by adding JIRA task number:
git branch 123-branch-name origin/master. Note that each branch you create should be based on master (origin/master). - You can start your implementation now, but remember to switch into your task branch:
git checkout 123-branch-name - After implementation is finished, merge your code into development branch. In order to do so, go into development branch:
git checkout developmentand merge your task branch into it by usinggit merge 123-branch-name. - Push both branches to Github:
git push origin development 123-branch-name - Push development branch to wpengine staging server:
git push staging development - Your changes are now ready for external testing. After customer approves them, you can merge them into master branch:
git checkout masterandgit merge 123-branch-name. Note that you should always merge task branch into master, never development branch. - Push master branch to Github:
git push origin master - Push master branch to wpengine production server:
git push production masterThat work flow gives possibility of working in parallel with multiple tasks/branches without deployment conflicts.