Introduction
Git-flow are a set of git extensions to provide High level repository operations for Vincent Driessen’s branching model.
- Git flow gives an excellent command line help and output.
- Git-flow is a merge based solution. It does not rebase feature branches.
Installation
- As prerequisite you need a working git installation.
- Git flow works on MacOsx, Linux and Windows
For OSX:
- With mac ports
port install git-flow
For Linux:
apt-get install git-flow
Getting Started
Git flow needs to be initialized in order to customize your project configuration.
Initialize
git flow init
It is recommended to use the default values when you are going to be asked on naming conventions for your branches
Features
- Develop new features for upcoming releases
- Typically exist in developers repos only
Start a New Feature
Development of new features starting from the ‘develop’ branch. Start developing a new feature with:
git flow feature start MYFEATURE
This action creates a new feature branch based on ‘develop’ and switches to it.
Finish up a Feature
Finish the development of a feature. This action performs the following:
- Merged MY_FEATURE into ‘develop’
- Removes the feature branch
- Switches back to ‘develop’ branch
git flow feature finish MY_FEATURE
Publish a Feature
Publish a feature to the remote server so it can be used by other users.
git flow feature publish MY_FEATURE
Getting a published Feature
Get a feature published by another user.
git flow feature pull origin MYFEATURE
Make a Release
- Support preparation of a new production release
Start a release
To start a release please use the git flow release command. It creates a release branch created from the ‘develop’ branch.
git flow release start RELEASE [BASE]
It is recommended to publish the release branch after creating it to allow release commits by other devs.
git flow release publish RELEASE
Finish up a release
Finishing a release is one of the big steps in git branching. It performs:
- Merges the release branch back into ‘master’
- Tags the release with its name
- Back-merges the release into ‘develop’
- Removes the release branch
git flow release finish RELEASE
Don’t forget to push your tags with git push --tags
HotFixes
- Hot-fixes brings from the necessity to act immediately upon an undesired state of a live production version
- May be branched off from the corresponding tag on the master branch that marks the production version.
Like the other git flow commands, a hotfix is started with:
git flow hotfix start VERSION [BASENAME]
The version argument hereby marks the new hotfix release name. Optionally you can specify a basename to start from.
Finish a HotFix
By finishing a hotfix it gets merged back into develop and master. Additionally the master merge is tagged with the hotfix version.
git flow hotfix finish VERSION
Posted in Git, Software Development, Technologies