Version Control Best Practices
When using version control for a web project at Yoobee School of Design, you should:
- Back up elsewhere (especially when getting started with Git)
- Avoid working directly on the master branch. Use a separate branch called “dev” for merging features and bug fixes into. When the dev branch is fully tested and stable, it can be merged into the master branch.
- Make commits of small logical complete units
- Commit early and often, perfect later, publish once
- Write good commit messages
- Test thoroughly before committing
- Use a branching strategy to prevent mixing up different lines of development
- Follow a style guide of an existing project or create one for a new project
- Review the CONTRIBUTING.MD file associated with an existing project or create one for a new project
- Look at existing pull requests and issues to make sure that you aren’t duplicating effort
Collaborative version control
- Agree on workflow
- Keep to your own unit of work
- Decide who is allowed to publish to the master repository
- Use a branching strategy to prevent mixing up different lines of development
- Keep to a naming convention for branches. For example: “name/feature/short-description” would be a naming convention for a following branch called “bob/contact-us/contact-form”
- Engage in peer review for prospective changes
- Consider using a pull request template