git-flow cheatsheet

created by Daniel Kummer

efficient branching using git-flow by Vincent Driessen

About

git-flow are a set of git extensions to provide high-level repository operations for Vincent Driessen's branching model. more

★ ★ ★

This cheatsheet shows the basic usage and effect of git-flow operations

★ ★ ★

Basic tips

★ ★ ★

Setup

★ ★ ★

OSX

$ brew install git-flow

Linux

$ apt-get install git-flow

Windows (Cygwin)

$ wget -q -O - --no-check-certificate https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | bash

For detailed git flow intallation instructions please visit the git flow wiki.

install git-flow

Getting started

Git flow needs to be initialized in order to customize your project setup.

★ ★ ★

Initialize

Start using git-flow by initializing it inside an existing git repository:

git flow init

You'll have to answer a few questions regarding the naming conventions for your branches.
It's recommended to use the default values.

Features

★ ★ ★

Start a new feature

Development of new features starting from the 'develop' branch.

Start developing a new feature with

git flow feature start MYFEATURE

This action creates a new feature branch based on 'develop' and switches to it

Finish up a feature

Finish the development of a feature. This action performs the following

  • Merged MYFEATURE into 'develop'
  • Removes the feature branch
  • Switches back to 'develop' branch
git flow feature finish MYFEATURE

Publish a feature

Are you developing a feature in collaboration?
Publish a feature to the remote server so it can be used by other users.

git flow feature publish MYFEATURE

Getting a published feature

Get a feature published by another user and track remote changes.

git flow feature pull MYFEATURE

Make a release

★ ★ ★

Start a release

To start a release, use the git flow release command. It

creates a release branch created from the 'develop' branch.

git flow release start RELEASE [BASE]

You can optionally supply a [BASE] commit sha-1 hash to start the release from. The commit must be on the 'develop' branch.

★ ★ ★

It's wise to publish the release branch after creating it to allow release commits by other developers. Do it similar to feature publishing with the command:

git flow release publish RELEASE

(You can track a remote release with the
git flow release track RELEASE command)

Finish up a release

Finishing a release is one of the big steps in git branching. It performs several actions:

  • Merges the release branch back into 'master'
  • Tags the release with it's name
  • Back-merges the release into 'develop'
  • Removes the release branch
git flow release finish RELEASE

Hotfixes

★ ★ ★

git flow hotfix start

Like the other git flow commands, a hotfix is started with

git flow hotfix start RELEASE

The release argument hereby marks the faulty production release

Finish a hotfix

By finishing a hotfix it gets merged back into develop and master. Additionally the master merge ist tagged.

git flow hotfix finish RELEASE

Commands

git-flow commands

Backlog

★ ★ ★

★ ★ ★

comments powered by Disqus