0% found this document useful (0 votes)
310 views

Git-Flow Cheatsheet

This document provides a summary of git-flow, a branching model for Git. It outlines the basic commands for initializing git-flow, creating and managing feature branches, release branches, and hotfix branches. The goal of git-flow is to provide an efficient workflow for larger projects with strict separation between development, release, and hotfix activities.

Uploaded by

nsedoud
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
310 views

Git-Flow Cheatsheet

This document provides a summary of git-flow, a branching model for Git. It outlines the basic commands for initializing git-flow, creating and managing feature branches, release branches, and hotfix branches. The goal of git-flow is to provide an efficient workflow for larger projects with strict separation between development, release, and hotfix activities.

Uploaded by

nsedoud
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

17/04/2020 git-flow cheatsheet

Fo
r
git-flow

k
m
e
on
Gi
tH
ub
cheatsheet
Tweet
created by Daniel Kummer

efficient branching using git-flow by Vincent Driessen

translations: English - Castellano - Português Brasileiro - 繁


體中文 (Traditional Chinese) - 简体中文
(Simplified Chinese) - 日
本語 - Türkçe - 한국어(Korean) - Français - Italiano -
Nederlands - Русский (Russian) - Deutsch (German) - Català
(Catalan) - Română (Romanian) - Ελληνικά (Greek) -
Українська (Ukrainian) - Tiếng Việt (Vietnamese) - Polski -
‫اﻟﻌﺮﺑﯿﺔ ﻓﺎرﺳﯽ‬
- - Lietuviškai (Lithuanian) - Azərbaycanca
(Azerbaijani) Bahasa Indonesia

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
★ Git flow provides excellent command line help and output.
Read it carefully to see what's happening...

https://danielkummer.github.io/git-flow-cheatsheet/ 1/9
17/04/2020 git-flow cheatsheet

★ The macOS/Windows Client Sourcetree is an excellent git gui


and provides git-flow support
★ Git-flow is a merge based solution. It doesn't rebase feature
branches.

★★★

Setup
★ You need a working git installation as prerequisite.
★ Git flow works on macOS, Linux and Windows
★★★

macOS For detailed git flow


Homebrew installation instructions please
visit the git flow wiki.
$ brew install git-flow-
avh

Macports
$ port install git-flow-
avh

Linux
$ apt-get install git-
flow

Windows (Cygwin)
$ wget -q -O - --no-
check-certificate
https://raw.github.com/pe
tervanderdoes/gitflow-
avh/develop/contrib/gitfl
ow-installer.sh install
stable | bash

You need wget and util-linux


to install git-flow.

https://danielkummer.github.io/git-flow-cheatsheet/ 2/9
17/04/2020 git-flow cheatsheet

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
★ Develop new features for upcoming releases
★ Typically exist in developers repos only
★★★

Start a new feature


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

Start developing a new feature


with
https://danielkummer.github.io/git-flow-cheatsheet/ 3/9
17/04/2020 git-flow cheatsheet

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

★ Merges 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.
https://danielkummer.github.io/git-flow-cheatsheet/ 4/9
17/04/2020 git-flow cheatsheet

git flow feature pull


origin MYFEATURE

You can track a feature on


origin by using

git flow feature track


MYFEATURE

Make a release
★ Support preparation of a new production release
★ Allow for minor bug fixes and preparing meta-data for 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
https://danielkummer.github.io/git-flow-cheatsheet/ 5/9
17/04/2020 git-flow cheatsheet

(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 its
name
★ Back-merges the release into
'develop'
★ Removes the release branch
git flow release finish
RELEASE

Don't forget to push your tags


with git push origin --tags

Hotfixes
★ Hotfixes arise from the necessity to act immediately upon an
undesired state of a live production version
★ May be branched off from the corresponding tag on the master
branch that marks the production version.

★★★

git flow hotfix start


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

https://danielkummer.github.io/git-flow-cheatsheet/ 6/9
17/04/2020 git-flow cheatsheet

git flow hotfix start


VERSION [BASENAME]

The version argument hereby


marks the new hotfix release
name. Optionally you can
specify a basename to start
from.

Finish a hotfix
By finishing a hotfix it gets
merged back into develop and
master. Additionally the
master merge is tagged with
the hotfix version.

git flow hotfix finish


VERSION

Commands

https://danielkummer.github.io/git-flow-cheatsheet/ 7/9
17/04/2020 git-flow cheatsheet

Backlog
★★★
★ Not all available commands are covered here, only the most
important ones
★ You can still use git and all its commands normally as you
know them, git flow is only a tooling collection
★ The 'support' feature is still beta, using it is not advised
★ If you'd like to supply translations I'd be happy to integrate
them

★★★

Comments

https://danielkummer.github.io/git-flow-cheatsheet/ 8/9
17/04/2020 git-flow cheatsheet

Sponsored

How To Watch Streaming/Netflix Services Like American


TheTopFiveVPN

Play this Game for 1 Minute and see why everyone is addicted
StrategyCombat

They Took The Same Picture For 40 Years. Don't Cry When You See The Last!
TopGentlemen.com

You Will Never Throw Away a Banana Peel Again After You See This
Health & Human Research

If You Drink Lemon Water Every Day Then This Will Happen to Your Body
Fitness Engage

Click to See These 7 Most Luxury Cruises...


Relocation Target

54 Comments git flow cheatsheet 🔒 Disqus' Privacy Policy 


1 Login

 Recommend 34 t Tweet f Share Sort by Best

Join the discussion…

LOG IN WITH
OR SIGN UP WITH DISQUS ?

Name

Ben Yitzhaki • 3 years ago


what is the best practice for fixing issues in release sprint while a new release is already on development (so we
can't edit the develop branch)? do them directly on the release branch? how can we handle Pull Request for the
fixes done on the release branch etc..?
3△ ▽ • Reply • Share ›

Evan Butler > Ben Yitzhaki • 2 years ago


IMO yes, make a branch off of releaseCandidate, then just create a PR to merge the fix branch into
releaseCandidate. Then the fix goes out with that release. After the release is merged with master, you

https://danielkummer.github.io/git-flow-cheatsheet/ 9/9

You might also like