We use git-flow to have master and development branches, merging at ease when working on hotfixes, features or releases with auto-tagging. We set the tag prefix to v to be able to standardize release versions. In example v1.0.0.
- Installation https://github.com/nvie/gitflow/wiki/Installation
- Watch introduction if unfamiliar https://vimeo.com/16018419
- Setup on your local repo by going into this project's directory and typing
git flow init. Press enter for every question except for tag-prefix: Typevand enter. This will automatically recognize master and develop branches and will set you on develop branch.
Git flow will automatically checkout develop branch. Here are some most commonly used scenarios:
git flow release start 1.0.0is only used when you are all committed indevelopbranch and need to tag. After you run the command, the only thing you need to do is updatepackage.jsonversion to1.0.0and commit. Then rungit flow release finish 1.0.0to automatically merge your release todevelopandmasterbranches and tag withv1.0.0git flow feature start my-great-featureis used when you want to branch out of develop into a new branch calledfeature/my-great-feature. When you are all committed in this branch and ready to bringmasteranddevelopup to the same level, simply rungit flow feature finish my-great-featureand it will merge it for you, bringing you back todevelopbranch. We usually don't push feature branches up to remotes unless they need collaboration.- When you forgot something while making a release, or want to add something to the
masterbranch, usegit flow hotfix start 1.0.1to create a hotfix based onmaster. After you are all committed, rungit flow hotfix finish 1.0.1which will merge your changes tomasteranddevelop, also tagging the release asv1.0.1
Here's a list of resources on GitHub.
- General An overview of general commands, like shortcuts.
- git flow init
- git flow feature
- git flow bugfix
- git flow release
- git flow hotfix
- git flow support
- git flow version
- git flow config
- Configuration
- Hooks and Filters