Introduction to Git Flow

This page is out of date and needs reviewing.

This is a branching model that defines a branching methodology that helps keep software development branches sane.


Git Flow tools

To use Git Flow it is easiest to install the Git Flow tools. These can be installed following the instructions:

Initialising a new or existing repository.

Whether a new or existing repository, the first thing to do is to initialise the repository as folows:

git flow init

This will prompt you for which branches to use for master and develop and naming conventions for feature, hotfix and support branches, and we will accept the defaults.

Once we have initialised git flow, we will be checked out on the develop branch.

From here on, we always work on the develop branch, branching off onto feature branches to do specific development.

Working on feature branches.

To start a feature branch, we issue the following command:

git flow feature start [featurename]

This will branch off from the develop branch to a feature/[featurename] branch.

We commit to this branch locally until such time as we are ready to merge back into the develop branch.

If we do need to collaborate on this branch with other developers, we can push this branch to origin by 'publishing' the feature:

git flow feature publish [featurename]

When we have finished work on the feature branch we can merge this back into the develop branch by 'finishing' the feature:

git flow feature finish [featurename]

This merges the feature branch back into the develop branch and deletes the feature branch.

See for more details.

Last updated: