git flow init
Follow along:
Which branch should be used for bringing forth production releases?
- develop
- dummy
- master
Branch name for production releases: [master]
Which branch should be used for integration of the "next release"?
- develop
- dummy
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? [v]
Features usally one per card.
This creates a new branch based on develop
and switches to it:
git flow feature start FEATURENAME
Push a feature branch to github.com:
git flow feature publish FEATURENAME
Get a feature published by another Dev from github.com:
git flow feature pull origin FEATURENAME
This creates a feature branch and publishes it for others to work on:
$ git pull
Already up-to-date.
$ git flow feature start my-new-thing
Switched to a new branch 'feature/my-new-thing'
Summary of actions:
- A new branch 'feature/my-new-thing' was created, based on 'develop'
- You are now on branch 'feature/my-new-thing'
Now, start committing on your feature. When done, use:
git flow feature finish my-new-thing
$ git flow feature publish my-new-thing
Total 0 (delta 0), reused 0 (delta 0)
To ssh://[email protected]:lantrix/test.git
* [new branch] feature/my-new-thing -> feature/my-new-thing
Already on 'feature/my-new-thing'
Your branch is up-to-date with 'origin/feature/my-new-thing'.
Summary of actions:
- A new remote branch 'feature/my-new-thing' was created
- The local branch 'feature/my-new-thing' was configured to track the remote branch
- You are now on branch 'feature/my-new-thing'
$ git checkout develop
Switched to branch 'develop'
Your branch is up-to-date with 'origin/develop'.
$ git checkout feature/my-new-thing
Switched to branch 'feature/my-new-thing'
Your branch is up-to-date with 'origin/feature/my-new-thing'.
This merges the feature into develop
, removes the feature branch, and switches to develop
:
git flow feature finish FEATURENAME
Create release branch from develop
:
git flow release start RELEASENAME
Publish release branch:
git flow release publish RELEASENAME
Create a local tracking branch for a remote release:
git flow release track RELEASENAME
Create a release; publish it and add a commit. Adding the commit causes the CI build to kick off automatically
git flow release start 1.0.0
git flow release publish 1.0.0
vim Readme.md
git commit -a -m "Release 1.0.0 Preparation"
git push
Merge release branch into master
, tag it, merge back into develop
, and remove the release branch:
git flow release finish RELEASENAME
git push --tags
Create hotfix branch from master
:
git flow hotfix start VERSIONNAME
Create hotfix branch from some other commit:
git flow hotfix start VERSIONNAME BASENAME
Merge hotfix back into develop and master, and tag:
git flow hotfix finish VERSIONNAME
- Command-line Arguments Reference: https://github.com/nvie/gitflow/wiki/Command-Line-Arguments
- git-flow Home: https://github.com/nvie/gitflow
- Detailed Cheatsheet: http://danielkummer.github.io/git-flow-cheatsheet/