2.1 Overview

Feature branches exist for each discrete development goal until that goal is reached. They are then deleted but the record of branch development is retained in history.

Branched from: stage

Merge into: stage

Naming Convention: anything except master, stage, release-*, or hotfix-*

2.2 Workflow

2.2.1 1) Create a feature branch

Features are built in branches off of stage. So the development code from the feature branch can be folded back into the stage branch and the production site is not in jeopardy of any mistakes you make while developing.

git checkout -b myfeature stage

The using checkout with the -b flag creates the branch and checks it out at the same time.

Now push this feature branch to the github repo so other developers can work on it if necessary.

git push origin myfeature

2.2.2 2) Code

Inside the checked out feature branch, do your coding...

Add and commit changes to the feature branch as you go along

git add .

and

git commit -m

2.2.3 3) Merge feature code into the stage branch

When you are ready to share code fold it into the stage branch.

checkout stage

git checkout stage

merge

git merge --no-ff myfeature

the --no-ff flag preserves the history of commits for this feature branch even after the feature branch is deleted.

The feature is now deployed to the stage branch in your local development environment. You need to push changes to the local stage branch up to Github for other developers to see...

push the changes to origin stage

git push origin stage

2.2.4 4) Lastly, delete the feature

Delete the feature branch locally

git branch -d <branch_name>

Delete branch on Github

git push origin --delete <branch_name>