Difference between revisions of "Git Flow"

From GLMWiki
Jump to: navigation, search
Line 17: Line 17:
 
  git clone git@cvs2:web/SooLocks.git <nowiki>www.soolocks.com</nowiki>
 
  git clone git@cvs2:web/SooLocks.git <nowiki>www.soolocks.com</nowiki>
 
  cd www.soolocks.com
 
  cd www.soolocks.com
  git flow init
+
  git flow init -d
Feature branches? [feature/]
+
Release branches? [release/]
+
Hotfix branches? [hotfix/]
+
Support branches? [support/]
+
Version tag prefix? []v
+
answer default to all but the prefix. for that use v
+
  
 
NOTICE: If others have been working on the project and have made a release or hotfixes before you you'll need to update all your branches. (usually your on only develop and only that is the one you are updating)
 
NOTICE: If others have been working on the project and have made a release or hotfixes before you you'll need to update all your branches. (usually your on only develop and only that is the one you are updating)
Line 29: Line 23:
  
 
git release
 
git release
  git release start 1.0 (then do your work and commit)
+
  git release start v1.0 (then do your work and commit)
  git release finish 1.0
+
  git release finish v1.0
  
 
git hotfix
 
git hotfix
  git hotfix start 1.0.1 (then do your work and commit)
+
  git hotfix start v1.0.1 (then do your work and commit)
  git hotfix finish 1.0.1
+
  git hotfix finish v1.0.1
  
 
When you're done with either a hotfix or release you need to push all branches and tags
 
When you're done with either a hotfix or release you need to push all branches and tags

Revision as of 16:35, 8 August 2014

Git Flow Workflow

git-flow

Branches:

master => used for production code only

develop => used for developing new features (never ending)

hotfix => used for maintenance (get merged into master and develop once done)

release => used for creating new releases of code from the develop branch (merges back into master and develop)


to start an project clone the git repo and initialize the git flow

git clone git@cvs2:web/SooLocks.git www.soolocks.com
cd www.soolocks.com
git flow init -d

NOTICE: If others have been working on the project and have made a release or hotfixes before you you'll need to update all your branches. (usually your on only develop and only that is the one you are updating)

git pull --all

git release

git release start v1.0 (then do your work and commit)
git release finish v1.0

git hotfix

git hotfix start v1.0.1 (then do your work and commit)
git hotfix finish v1.0.1

When you're done with either a hotfix or release you need to push all branches and tags

git push --all
git push --tags

NOTICE: it is wise to do a git pull first before you start with a release or hotfix

Tutorials

Git Flow

When to use hotfix

Use a hotfix for doing any small site updates like graphic changes or text changes. These changes are typically not considered

When to use develop

For new features or revamps.