On Github opdavies / what-is-git-flow
By Oliver Davies / @opdavies
Drupal for 8 years, Git since for 4 years, Git Flow for a year~ $ git flow init
~ $ 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]
~ $ 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? []
~ $ git flow init -d # Accepts the default branch names.
Adding -d accepts the default branch names.
$ git flow feature
~ $ git flow feature start {name}
~ $ 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
~ $ drush dl admin_menu ~ $ git add sites/all/modules/contrib/admin_menu ~ $ git commit -m "Added admin_menu"
~ $ git flow feature finish {name}
~ $ 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...
$ git flow release
~ $ git flow release start {version}
~ $ git flow release start 2014-03-02.0 Switched to a new branch 'release/2014-03-02.0' Summary of actions: - A new branch 'release/2014-03-02.0' was created, based on 'develop' - You are now on branch 'release/2014-03-02.0' Follow-up actions: - Bump the version number now! - Start committing last-minute fixes in preparing your release - When done, run: git flow release finish '2014-03-02.0'
Adding -d accepts the default branch names.
~ $ git flow release finish {version}
~ $ git flow release finish 2014-03-02.0 ... Deleted branch release/2014-03-02.0 (was f2aee7d). Summary of actions: - Latest objects have been fetched from 'origin' - Release branch has been merged into 'master' - The release was tagged '2014-03-02.0' - Release branch has been back-merged into 'develop' - Release branch 'release/2014-03-02.0' has been deleted
~ $ git push --all # Push the changes to the remote branches. ~ $ git push --tags # Push the tags.
~ $ git flow release finish -pm {message} {version} # Specify a commit message and automatically push the changes.
~ $ git flow release finish -pm 2014-03-02.0 2014-03-02.0
$ git flow hotfix