Difference between revisions of "Git Flow"

From GLMWiki
Jump to: navigation, search
(When to use develop)
Line 45: Line 45:
 
== When to use develop ==
 
== When to use develop ==
 
For new features or revamps.
 
For new features or revamps.
 +
 +
== When to use support ==
 +
These branches are just started and not intended to be merged back to master nor develop. This is usually fine, as fixes to "ancient" releases or features requested by customers to be implemented in "ancient" releases can't or should not go back into master. If you still think, you want to port a fix to your main development line (represented by master and develop), just start a hotfix, cherry-pick your changes and finish the hotfix.

Revision as of 16:44, 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.

When to use support

These branches are just started and not intended to be merged back to master nor develop. This is usually fine, as fixes to "ancient" releases or features requested by customers to be implemented in "ancient" releases can't or should not go back into master. If you still think, you want to port a fix to your main development line (represented by master and develop), just start a hotfix, cherry-pick your changes and finish the hotfix.