Git-flow
official resource :
https://danielkummer.github.io/git-flow-cheatsheet/
Contents
What is git-flow
git-flow are a set of git extensions to provide high-level repository operations for Vincent Driessen's branching model.
This document 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...
- 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.
Installation
You need a working git installation as prerequisite. git
Git flow works on macOS, Linux and Windows
macOS
$ brew install git-flow-avh
$ port install git-flow-avh
Linux
$ apt-get install git-flow
Windows (Cygwin)
$ wget -q -O - --no-check-certificate https://raw.github.com/petervanderdoes/gitflow-avh/develop/contrib/gitflow-installer.sh install stable | bash
You need wget and util-linux to install git-flow.
Hello World with git-flow
Git flow needs to be initialized in order to customize your project setup.
Create new git repo
$ mkdir git-flow-helloworld
$ cd git-flow-helloworld
$ echo "# git-flow helloworld" >> README.md
$ git init
$ git add README.md
$ git commit -m "git-flow first commit"
$ git remote add origin https://github.com/[git account username]/git-flow-helloworld.git
$ git push -u origin master
Initialize git-flow
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.
$ git flow init
Which branch should be used for bringing forth production releases?
- master
Branch name for production releases: [master]
Branch name for "next release" development: [develop] develop
How to name your supporting branch prefixes?
Feature branches? [feature/]
Bugfix branches? [bugfix/]
Release branches? [release/]
Hotfix branches? [hotfix/]
Support branches? [support/]
Version tag prefix? []
Hooks and filters directory? [/workspace/git-flow-helloworld/.git/hooks]