-
Notifications
You must be signed in to change notification settings - Fork 1
Git Flow
nt3rp edited this page Apr 16, 2012
·
4 revisions
Keeping the codebase in a good state is difficult. It is all too easy to just make a fix on master and hope things work out. Such development can be troublesome when it comes to merges and fixes. This is why we've introduced git-flow to the repository.
NOTE: If you are concerned about remembering commands, there is a git-flow completion plugin for BASH and zsh.
To get started, you'll need to install gitflow as described here. Once that is done, you'll need to setup your local repository to use gitflow.
- Make sure that the following branches exist in your local environment, and if they do not, create them.
-
dev(should branch off master) master
-
- Run the following command to initialize git flow:
git flow init- When prompted for the branch name for production releases, use the default (master)
- When prompted for the branch name for "next release" development, use
dev - Accept the other defaults as they are
- Note: If you encounter any problems with the wizard, you can restart it from scratch using the
-fflag, like so:git flow init -f
- That's it!
There is a really good article on the git-flow branching model, but for our purposes, I've summarized below:
- Create a feature (
git flow feature start MYFEATURE) - Work on the feature normally, committing to that branch, and occasionally pulling from
dev(git pull origin dev,git add .,git commit, etc) - When work on a feature is complete, submit a pull request to have the code integrated into
dev - When the code review is completed satisfactorily, it will be merged into
dev(git flow feature finish MYFEATURE)
See the article for more details.
- Master
- Bulletproof; this is what is deployed on
social-referral
- Bulletproof; this is what is deployed on
- Hotfix
- If serious issues are found, we create hotfix branches to get things fixed ASAP (
git flow hotfix start HOTFIXNAME) - Note that hotfixes are not merged into existing release branches
- If serious issues are found, we create hotfix branches to get things fixed ASAP (
- Release
- The features for release X are pretty much ready to go. Dot the i's and cross the t's and we're ready for a new version! (
git flow release start 0.X)
- The features for release X are pretty much ready to go. Dot the i's and cross the t's and we're ready for a new version! (
- Dev
- This is where code intermingles. Feature branches are merged into here after code review, as are hotfixes and release branches
- Feature Branches
- This is where the majority of the work occurs