git-flow is a set of git extensions to provide high-level repository operations for Vincent Driessen's branching model.
- Gitflow provides excellent command line help and output.
- Sourcetree is an excellent git gui and provides git-flow support for macOs/Windows
- Git-flow is a merge based solution. It doesn't rebase feature branches
$ brew install git-flow-awh
$ apt-get install git-flow
$ wget -q -O - --no-check-certificate https://raw.github.com/petervanderdoes/gitflow-avh/develop/contrib/gitflow-installer.sh install stable | bash
You need wget and util-Linux to install git-flow
Git flow needs to be initialized in order to customize your project setup
start a git flow by initializing it inside an existing git repository
git flow init
you will have to answer a few questions regarding naming conventions for your branches. It recommended using the default values.
git flow feature start FEATURENAME
- This action creates a new feature branch based on 'develop' and switches to it.
git flow feature finish FEATURENAME
- Merges FEATURENAME into 'develop'
- Removes the feature branch
- Switches back to 'develop' branch
git flow feature publish FEATURENAME
Are you developing a feature in collaboration? Publish a feaure to the remote server so it can be used by other users.
Getting a published feature by another user.
git flow feature pull origin FEATURENAME
Track a feature on origin
git flow feature track FEATURENAME
Support prep of a new production release
To start a new release use a git flow release command. It creates a release branch from the 'develop' branch
git flow release start RELEASE
It's good to publish the release branch after creating to the allow release commits by other developers.
git flow release publish RELEASE
git flow release finish RELEASE
- Merges the release branch back into 'master'
- Tags the release with it's name
- Back-merges the release into 'develop'
- Removes the release branch
Don't forget to push your tags with
git push origin --tags
- Hotfixes arise from the necessity to act immediately upon an undesired state of a live production version
- May be branched off from the corrosponding tag on the master branch that marks the production version
git flow hotfix start VERSION
- Creates a hotfix brach from a 'master' and switches to the branch
git flow hotfix finish VERSION
- Back-merge the hotfix into 'master' and 'develop'
- Delete the hotfix branch
- Switches back to the 'master'
- Not all available commands are mentioned here, only the most important ones
- You can still use git and all it's commands normally as you know them, git flow is only tooling collection
- The 'support' feature is still beta, using it is not advised