Git Flow Workflow A powerful way to use GIT
May 15, 2015
Git Flow WorkflowA powerful way to use GIT
Who am I?John Congdon
I have specialized in ecommerce since 2001
Sole developer/IT guy for bowlingball.com
Website (ecommerce)
Dropshipping Integration
Inventory management (picking/shipping)
Pro shops retail POS system
What is GIT?A distributed revision control repository
A complete copy exists with every clone
A smart way to code
Works Great for Single developers
Small teams
Large teams (open source teams are distributed worldwide)
I Thought This Talk Was About
Git FlowWhat is Git Flow?A development model created by Vincent Driessen
He is known online as nvie (nvie.com)
My personal version control storySole programmer = bad habits
Worked on live code
Didn’t have versions / fall back points
No idea what may have changed (good or bad)
I WAS STILL CONFUSED
I had the printout on my desk
I tried desperately to follow the flow
I always fell back into my old habits of editing live code (It’s just faster)
My Turning PointI wouldn’t be giving this talk without one, would I?
Why Aren’t You Using Git Flow?By Jeff Kreeftmeijer
http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/
Let’s Get StartedInstall git & git-flow
Using BASH or ZSH?Install git & git-flow autocompletion
Start a Projectgit init creates a new git repo
git flow init initializes git flow
Accept the defaults. There are good reasons to do so.
Most open source projects use this format
Everyone that works on your code needs to have the same settings
Every cloned repo needs to run git flow init
Git flow featureA branch of development when working on new features
A feature branch is created off of the develop branch
You can have many feature branches at the same time
I primarily live in feature branches
We use Bugzilla at work as our IT request systemMy feature branch names: BugXXX-DescriptiveName
When finished, branch is merged back into develop
Start usage: git flow feature start XYZ
Finish usage: git flow feature finish XYZ
Git flow hotfixA branch used to fix production code
Branch is created off of master
My hotfix branch names follow the same convention
When finished, branch is merged back into master and develop
I also use these for “mini” features or quick improvements
I do this in place of editing live code now
Start usage: git flow hotfix start XYZ
Finish usage: git flow hotfix finish XYZ
Git flow feature rebase
Used to bring a feature branch up to date with develop
I use this on long running feature branches (major/unreleased feature)
A good idea before finishing a feature branch. Easier to solve merge conflicts this way in my opinion.
Rewinds current feature, pulls in changes from develop, replays current feature.
Git flow releaseThis is an in between branch
Created from develop
My release names are v0.9.XX, mostly arbitrary
Changes can be made (usually release notes, updating version info, or any other change before ready for production)
When finished, branch is merged into both master and develop
PHP Community Resources
Twitter is my friendMe @johncongdon
David Rogers @al_the_ax
Cal Evans @CalEvans
Lorna Jane @lornajane
Vincent Driessen @nvie
Travis Swicegood @tswicegood
ReferencesThe source
http://nvie.com/posts/a-successful-git-branching-model/
Why Aren’t You Using Git Flow? By Jeff Kreeftmeijer
http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/
Git Flowhttps://github.com/nvie/gitflow