Setup Git Flow

by richy486 in Circuits > Software

5825 Views, 13 Favorites, 0 Comments

Setup Git Flow

Screen Shot 2015-03-28 at 3.20.49 pm.png

Open Source tree or download it from http://www.sourcetreeapp.com/

Turn on Git Flow

Screen Shot 2015-03-28 at 3.06.31 pm.png

Click the Git Flow button in the top bar.

Get Flow Settings

Screen Shot 2015-03-28 at 3.19.45 pm.png

If this screen appears it means git flow hasn't been setup yet. Click ok to the default settings.

If a different screen appears you can click cancel.

Develop Branch

Screen Shot 2015-03-28 at 3.07.33 pm.png

Now you should have at least two branches: Master and Develop.

Master is the branch all the working code that is ready for a public build should be on

Develop is the branch where all the in development features should go, code here should be working but it is a safety net if some bugs are here before going to Master. If you are doing very small changes commit your code to this branch.

Create a New Feature

Screen Shot 2015-03-28 at 3.08.10 pm.png

Normally if you are adding a new feature you will create a branch for that feature.

Click the Git Flow button again then click Start a New Feature.

Set Up the Feature Branch

Screen Shot 2015-03-28 at 3.08.37 pm.png

Type in a name for this branch, e.g. add_sound then click Ok.

Working on the Feature Branch

Screen Shot 2015-03-28 at 3.09.19 pm.png

Now your feature branch has been created under feature/add_sound. Commit and push your changes as normal to this branch until the feature has been fully implemented.

Finish Working on the Branch

Screen Shot 2015-03-28 at 3.14.16 pm.png

Once the feature has been implemented you can click the Git Flow button again and click Finish Current. This will merge the feature branch back into develop.

It's a good idea to keep merging develop into your feature branch regularly to avoid the feature branch straying too much from the develop branch.