Every repo that the team works on should have at least three branches:
- Avoid including files in source control that are specific to your development machine or process
- Delete local and remote feature branches after the feature has been deployed to production
- Perform work in a feature branch
- Use sentence case for commit messages and make them concise but usefully descriptive
- Rebase frequently to incorporate upstream changes
- Use a pull request for code reviews (thoughtbot's code review guidelines are good).
How to set up a new repo
- Create private repo in digital org with README.md
- Remove Wikis and Issues under Settings > Options
- Create production and staging branches
- Set staging to be the default branch
- Delete master branch
- Add the Digital team as 'Admin' under Settings > Collaborators and teams
- Set the default branch to be protected and require pull request reviews before merging, including administrators
Continuous integration and continuous deployment
We set up a build and deploy of the production branch in Bamboo and then enable plan branches. This means that all new branches will automatically get a build plan created for them.
We use the GitHub Bamboo Service (via repo_page -> Settings -> Webservices & Hooks) to trigger a build each time a commit is made.
Commits to the
staging branches are automatically deployed by Continuous Integration, provided they pass their unit tests and acceptance tests.