Follow Git branching model
-
masteris for production -
developfor test (next release) -
featurecreated from develop for merging to develop -
releasecreated from develop for merging to master -
hotfixcreated from master for merging to master
Install Git-flow
git flow init or git flow init -f to force the initialization.
You can also use the default git config with git config --local include.path ../.gitconfig
If you receive some error about a branch that doesn't exist, checkout or create it.
Start new feature
git flow feature start feature-name
Finish feature development
git flow feature finish feature-name
git push to update remote
Start new release from develop for merge changes to master
git flow release start 1.0.0
Finish release
git flow release finish 1.0.0
git push to update remote
Start new hotfix from master
git flow hotfix start 1.0.1
Finish hotfix and merged to master
git flow hotfix finish 1.0.1
git push to update remote
User semver for versioning your app
If you get this error:
Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first
Solve by doing this:
- git add .
- git commit -m "Saving edits"
- git push
- git checkout develop
- git checkout master
- git flow init -d -f
or you can
- Open the .git\config
- Remove from
[gitflow "xxx"]till the other brackets. - Rerun
git flow init