What is Git Flow? – An introduction to the Git Flow branching model



What is Git Flow? – An introduction to the Git Flow branching model

0 0


drupalcamp-london-git-flow


On Github opdavies / drupalcamp-london-git-flow

What is Git Flow?

An introduction to the Git Flow branching model

By Oliver Davies / @opdavies

Git Flow is...

"Git extensions to provide high-level repository operations for Vincent Driessen's branching model."

From https://github.com/nvie/gitflow

How do I use it?

What does it do?

Branches

  • master: production code (stable)
  • develop: development code (unstable)
  • feature/*: a specific task or ticket (multiple)
  • release/*: temporary release branch for testing (single)
  • hotfix/*: temporary branch for emergency fixes

Getting started

Initialising Git Flow...

~ $ git flow init

Getting started

Creating your production and development branches.

~ $ git flow init

No branches exist yet. Base branches must be created now.
Branch name for production releases: [master]
Branch name for "next release" development: [develop]

Getting started

Initialising Git Flow...

~ $ git flow init

No branches exist yet. Base branches must be created now.
Branch name for production releases: [master]
Branch name for "next release" development: [develop]

How to name your supporting branch prefixes?
Feature branches? [feature/]
Release branches? [release/]
Hotfix branches? [hotfix/]
Support branches? [support/]
Version tag prefix? []

Getting started

Faster.

~ $ git flow init -d
# Accepts the default branch names.

Features

Starting your first feature branch.

~ $ git flow feature start foo
* Branches from develop

Features

Starting your first feature branch.

~ $ git flow feature start foo

Switched to a new branch 'feature/foo'

Summary of actions:
- A new branch 'feature/foo' was created, based on 'develop'
- You are now on branch 'feature/foo'

Now, start committing on your feature. When done, use:

git flow feature finish foo

Features

Add and commit any changes as normal.

~ $ drush dl admin_menu
~ $ git add sites/all/modules/contrib/admin_menu
~ $ git commit -m "Added admin_menu"

Features

Finishing a feature.

~ $ git flow feature finish foo

Features

Finishing a feature.

~ $ git flow feature finish foo

Switched to branch 'develop'
Already up-to-date.
Deleted branch feature/foo (was d0cadf1).

Summary of actions:
- The feature branch 'feature/foo' was merged into 'develop'
- Feature branch 'feature/foo' has been removed
- You are now on branch 'develop'

And repeat...

Releases

Hotfixes

Resources

Questions?