UPGRADE TO GET UP TO 85% OFF GITKRAKEN PRO
Search
Close this search box.

What is Git Flow

Updated on: 6/17/2022

Git flow is a popular Git branching strategy aimed at simplifying release management, and was introduced by software developer Vincent Driessen in 2010. Fundamentally, Git flow involves isolating your work into different types of Git branches. In this article, we’ll cover the different branches in the Git flow workflow, how to use Git flow in GitKraken Desktop, and briefly discuss two other Git branching strategies, GitHub flow and GitLab flow. 

The Git Flow Workflow

In the Git flow workflow, there are five different branch types:

  1. Main
  2. Develop
  3. Feature
  4. Release
  5. Hotfix

Other Git Branching Strategies 

GitHub Flow

GitLab Flow

The Git Flow Diagram

Git Flow

Custom image inspired by Vincent Driessen in “A Successful Git Branching Model”.

GitKraken Desktop makes configuring and customizing your Git flow settings quick and easy.

Git Flow: Main Branch

Please note: the main branch is commonly referred to as “master”; we have made an intentional decision to avoid that outdated term and have chosen to use “main” instead.

The purpose of the main branch in the Git flow workflow is to contain production-ready code that can be released.

In Git flow, the main branch is created at the start of a project and is maintained throughout the development process. The branch can be tagged at various commits in order to signify different versions or releases of the code, and other branches will be merged into the main branch after they have been sufficiently vetted and tested.

Git Flow: Develop Branch

The develop branch is created at the start of a project and is maintained throughout the development process, and contains pre-production code with newly developed features that are in the process of being tested.

Newly-created features should be based off the develop branch, and then merged back in when ready for testing.

Git Flow: Supporting Branches

When developing with Git flow, there are three types of supporting branches with different intended purposes: feature, release, and hotfix.

Git Flow: Feature Branch

The feature branch is the most common type of branch in the Git flow workflow. It is used when adding new features to your code.

When working on a new feature, you will start a feature branch off the develop branch, and then merge your changes back into the develop branch when the feature is completed and properly reviewed.

Git Flow: Release Branch

The release branch should be used when preparing new production releases. Typically, the work being performed on release branches concerns finishing touches and minor bugs specific to releasing new code, with code that should be addressed separately from the main develop branch.

Git Flow: Hotfix Branch

In Git flow, the hotfix branch is used to quickly address necessary changes in your main branch.

The base of the hotfix branch should be your main branch and should be merged back into both the main and develop branches. Merging the changes from your hotfix branch back into the develop branch is critical to ensure the fix persists the next time the main branch is released.

How to use Git Flow in GitKraken Desktop

Now that we’ve covered what Git flow is, let’s take a look at how to use Git flow in GitKraken Desktop. 

To start using a Git flow workflow in GitKraken Desktop, perform the following steps:

  1. Navigate to Preferences in the top toolbars
  2. In the left panel select Gitflow and set your preferred branch naming conventions 
  3. and Select then hit the green Initialize Gitflow button

Now when you exit Preferences, you see a Gitflow section at the top of the left panel. From here, 

GitKraken Desktop will help you start and finish feature, release, and hotfix branches.

Start and finish Git flow options in GitKraken Desktop

For example, most devs will probably hit “Feature” and then name and create their feature branch:

Create a Git flow feature branch in GitKraken Desktop

Then when your feature branch has been approved, you may close the feature branch using the Gitflow panel. This will automatically merge the feature branch into develop, or alternatively, you can choose to rebase the feature branch on develop instead.

Close a Git flow feature branch in GitKraken Desktop

Try using Git flow with GitKraken Desktop for free.

Git Flow FAQs

Q: What is a Git flow?

A: Git flow is a Git branching strategy created to make releasing new versions of software easier. 

Q: How to install Git flow?

A: Git flow is a Git branching strategy, and therefore isn’t a tool or software that can be downloaded. Developers can use Git flow to organize their Git branches and development process to ship releases more efficiently. 

Other Git Workflows

While the popularity of Git flow has soared since its inception in 2010, even Driessen himself admits that it might not be the optimal Git workflow for every development team or environment, as is shown in his “Note of reflection” from March 2020.

“Web apps are typically continuously delivered, not rolled back, and you don’t have to support multiple versions of the software running in the wild. This is not the case of software that I had in mind…10 years ago.”

There are two Git workflows that are more simple than Git flow and can allow for continuous delivery.

GitTip: Learn more about Git branch strategies, including in-depth details and workflow diagrams for GitHub flow and GitLab flow.

GitHub Flow

More simple than Git flow, GitHub flow is great for smaller teams and web applications or products that don’t require supporting multiple versions. Because of its simplicity, the GitHub flow workflow allows for continuous delivery and continuous integration.

Of course, there are also related risks to consider. The lack of dedicated development branches, for example, makes this workflow more susceptible to bugs in production.

GitLab Flow

Also more simple than Git flow, GitLab flow is more organized and structured when compared to the GitHub flow workflow.

GitLab flow introduces environment branches, such as production and pre-production, or release branches, depending on your situation.

With slight modifications, GitLab flow can allow for versioned releases and continuous delivery.

Get Started with Git Flow in GitKraken Desktop

At its core, Git flow helps better organize your work. Combine that with the visual power of a Git client to take your workflow to the next level.

GitKraken Desktop supports Git flow and allows you to customize branch names and other details to your liking during the configuration process. This can be particularly helpful for standardizing processes across development teams for more effective collaboration. Discover more about using Git flow with GitKraken Desktop.

Additional Resources

Table of Contents

Make Git Easier, Safer &
More Powerful

with GitKraken

Visual Studio Code is required to install GitLens.

Don’t have Visual Studio Code? Get it now.

Team Collaboration Services

Secure cloud-backed services that span across all products in the DevEx platform to keep your workflows connected across projects, repos, and team members
Launchpad – All your PRs, issues, & tasks in one spot to kick off a focused, unblocked day. Code Suggest – Real code suggestions anywhere in your project, as simple as in Google Docs. Cloud Patches – Speed up PR reviews by enabling early collaboration on work-in-progress. Workspaces – Group & sync repos to simplify multi-repo actions, & get new devs coding faster. DORA Insights – Data-driven code insights to track & improve development velocity. Security & Admin – Easily set up SSO, manage access, & streamline IdP integrations.
winget install gitkraken.cli