Show Menu
Cheatography

Git Flow and git Cheat Sheet (DRAFT) by

gitflow vs git raw commands

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Install

Linux
apt-get install git-flow
Windows (cygwin)
macOS (homebrew)
brew install git-fl­ow-avh
macOS (macports)
port install git-fl­ow-avh

Features / Create a branch

gitflow
git
git flow feature start MYFEATURE
git checkout -b featur­e/M­YFE­ATURE develop

Features / Get latest from branch

gitflow
git
git flow feature pull origin MYFEATURE
git checkout featur­e/M­YFE­ATURE
 
git pull --rebase origin featur­e/M­YFE­ATURE

Features / push merged branch

gitflow
git
N/A
git push origin develop
 
git push origin :featu­re/­MYF­EATURE
(if pushed)

Hotfixes / create branch

gitflow
git
git flow hotfix start 1.2.1 [commit]
git checkout -b hotfix­/1.2.1 [commit]

Hotfixes / Push merged branch

gitflow
git
N/A
git push origin master
 
git push origin develop
 
git push origin --tags
 
git push origin :hotfi­x/1.2.1
(if pushed)

Releases / Get latest for branch

gitflow
git
N/A
git checkout releas­e/1.2.0
 
git pull --rebase origin releas­e/1.2.0

Releases / Finalize

gitflow
git
git flow release finish 1.2.0
git checkout master
 
git merge --no-ff releas­e/1.2.0
 
git tag -a 1.2.0
 
git checkout develop
 
git merge --no-ff releas­e/1.2.0
 
git branch -d releas­e/1.2.0
 

Initialize

gitflow
git
git flow init
git init
 
git commit --allo­w-empty -m "­Initial commit­"
 
git checkout -b develop master

Connect to the remote repository

gitflow
git
N/A
git remote add origin git@gi­thu­b.com:MYACC­OUN­T/M­YREPO

Features / Share a branch

gitflow
git
git flow feature publish MYFEATURE
git checkout featur­e/M­YFE­ATURE
 
git push origin featur­e/M­YFE­ATURE

Features / Finalize branch

gitflow
git
git flow feature finish MYFEATURE
git checkout develop
 
git merge --no-ff featur­e/M­YFE­ATURE
 
git branch -d featur­e/M­YFE­ATURE

Hotfixes / Finalize branch

gitflow
git
git flow hotfix finish 1.2.1
git checkout master
 
git merge --no-ff hotfix­/1.2.1
 
git tag -a 1.2.1
 
git checkout develop
 
git merge --no-ff hotfix­/1.2.1
 
git branch -d hotfix­/1.2.1

Releases / Create a branch

gitflow
git
git flow release start 1.2.0
git checkout -b releas­e/1.2.0 develop

Releases / Share branch

gitflow
git
git flow release publish 1.2.0
git checkout releas­e/1.2.0
 
git push origin releas­e/1.2.0

Releases / Push merged branc

gitflow
git
N/A
git push origin master
 
git push origin develop
 
git push origin --tags
 
git push origin :relea­se/­1.2.0
(if pushed)

References