Git Flow Cheat Sheet

Here’s a cheat sheet for using Git Flow, a branching model extension for Git:

Initialize Git Flow

Initialize Git Flow:

git flow init
  • Follow the prompts to set up the default branch names.

Feature Branches

Start a Feature Branch:

git flow feature start feature_name

Finish a Feature Branch:

git flow feature finish feature_name

Release Branches

Start a Release Branch:

git flow release start version_number

Finish a Release Branch:

git flow release finish version_number

Hotfix Branches

Start a Hotfix Branch:

git flow hotfix start version_number

Finish a Hotfix Branch:

git flow hotfix finish version_number

Support Branches

Start a Support Branch:

git flow support start version_number

Finish a Support Branch:

git flow support finish version_number

Publish Branches

Publish a Branch to Remote:

git flow feature publish feature_name

Track a Remote Branch:

git flow feature track feature_name

Other Useful Commands

List Existing Features, Releases, Hotfixes:

git flow feature
git flow release
git flow hotfix

Push Changes to Remote Repository:

git flow feature publish feature_name
git flow release publish version_number
git flow hotfix publish version_number

Finish Without Closing Issue

Finish Feature or Release Without Closing Issue:

git flow feature finish -k feature_name
git flow release finish -k version_number

Custom Configuration

Customize Git Flow Configuration: Edit the .git/config file or use the following commands:

git config gitflow.feature.start.fetch origin develop
git config gitflow.feature.finish.fetch origin develop

This cheat sheet covers the basics of using Git Flow for managing your Git branching model. Adjustments to the workflow might be needed based on your specific project requirements.