Skip to content

Git Workflow

Sam Richard edited this page Jan 20, 2022 · 1 revision

The main branch. The ultimate source of truth. All branches should derive from main. Before starting a new branch, make sure your main branch is up-to-date.

High-level guide to make changes

  • Check out your main branch and update it with the latest changes on GitHub
  • Create a branch
  • Make your changes in your branch
  • Lint your files with prettier npm run prettier
  • Commit your changes
  • Push your changes
  • Make a pull request from your branch

Branch naming convention

While not required, we recommend the following branch naming conventions.

  • A feature branch. Use a feature/<name> branch when you want to work on a new feature for the site. <name> should be a short description of the feature.
  • A content branch. Use a content/<name> branch when you want to work on new content for the site. <content> should be a short description of the content.
  • A bug branch. Use a bug/<id> branch when you want to work on a reported issue. <id> should be the GitHub issue id.
  • A hotfix branch. Use a hotfix/<name> branch when you want to work on a critical issue. <name> should be a short description of the issue.

Creating a pull request (PR)

General considerations.

  • Use the PR description template configured for the project.
  • Write a conforming title (see the Contributing guidelines)
  • Use branches out of the main branch to create PRs. Avoid using branches of other branches.
  • Make sure to link the PR to the issues it solves. GitHub provides many options. Favor the use of the resolves keyword in the PR description that comes with the template.
  • After the PR is approved and the branch merged, make sure to remove the branch from the repository. This can be done from the PR’s detail page.
  • Use ZenHub to fill all the extra information. Check the project management tools section for instructions on how to integrate GitHub and ZendHub.
  • Connect the PR with an existing issue. This one is different from the linked issues connected using the regular GitHub process.
  • Include as much information as possible. i.e. Epics, Labels, Releases, Milestones, etc.

Staging links

The project uses Firebase to automatically generate staging links. When a new PR is created a and passes the relevant tests, a staging link with the changes will be added as a comment to the PR.