Git Flow Tutorial Part 2 - Git Flow in SourceTree


Prerequisite

To fully comprehend this tutorial, please watch the first video in this series. Tutorial - What is Git Flow

Set Up

First of all, you need to initialize Git Flow on your repository. If you clone an existing repository, which has uses Git Flow, you will still have to initialize Git Flow on your local copy. Below is a list of steps you need to follow to initialise Git Flow on your repository.

  1. Initialize repository.

  2. Initialize Git Flow using the "Git Flow" icon.

  3. Name your branches and prefixes.

  4. You will now have a "master" and a "develop" branch.

Create your first "feature branch"

Follow the steps below to create a "feature branch" on your repository.

  1. Make sure your are on the "develop" branch.

  2. Click on the "Git Flow" icon.

  3. Click "Start New Feature".

  4. Name your "feature branch".

  5. Continue to work on your "feature branch"

Finishing our "feature branch"

Follow the steps below to finish or close a "feature branch" on your repository.

  1. Once we have completed our feature, we can merge it into "develop".

  2. Click on the "Git Flow" icon.

  3. Click "Finish Feature".

  4. Real world – pull "develop" first.

  5. Real world – look out for merge conflicts.

Starting a "release branch"

Follow the steps below to start a "release branch" on your repository.

  1. Make sure you are on the "develop" branch.

  2. Click on the "Git Flow" icon.

  3. Click "Start New Release".

  4. Commit any change if necessary.

Finishing a "release branch"

Follow the steps below to finish or close a "release branch" on your repository.

  1. Make sure you are on the "release branch".

  2. Click on the "Git Flow" icon.

  3. Click "Finish Release".

  4. Tag your release.

  5. Finishing the release, will merge the "release branch" into "master" and "develop".

Hot Fixes

Follow the steps below to create a "release branch" on your repository.

  1. Click the "Git Flow" icon.

  2. Click "Start New Hotfix".

  3. Make your changes on the "hotfix" branch.

  4. Click the "Git Flow" icon when you have completed your changes.

  5. Click "Finish Hotfix"

Hot fixes are merged into "develop" and "master". Please note: if you have any release branches open when you are finishing a "hot fix", you will have to merge the "hot fix" into the release branch too.






Arrow Icon