Skip to content

Development Workflow

Vincent Feistel edited this page Nov 3, 2023 · 10 revisions

This project makes use of git flow (as recommended by the module), a branching strategy that has two long-lived branches:

  • develop - Contains all the code that we are currently working on
  • master - Contains a deployable, "demo-ready" version of the project

These branches are meant to be mostly stable, and because of this you cannot push these branches; contributing is detailed below. Unless you are this narcissist who thinks he is above the rules:

image

Commits

Commits should be made at the developers discretion but try to only commit when significant change is made, i.e. don't commit every comment. Please use descriptive names for your commit messages and should always start with a verb. Also as above stated you cannot commit directly to dev or main.

Feature Branch

When you need to contribute to the project, e.g. developing a new feature:

  1. Create a new branch from the develop branch named feat/xxx, where xxx is a descriptive name of your feature, e.g. feat/sprite-loader
  2. Work on this branch, committing as needed.
  3. Once the feature is complete, create a pull request from feat/xxx into develop (requires 1 approval) image

Release Branch

A release branch is a stepping stone between develop and master, used when we are preparing the project for "deployment:"

  1. Create a new branch from the develop branch named release/xxx (see below)
  2. Commit the final finishing touches required for a demo/deployment.
  3. Once finished, create a pull request into both develop and master (requires 1 and 2 approvals respectively)

When creating a release branch, use the naming convention release/xxx, where xxx is a short feel-good message to any member of the team. For example

release/matilda-is-the-best

image

Hotfix Branch

Hotfixes are for when a quick fix needs to be made on demo day when you cannot follow proper due process:

  1. Create a new branch from master named hotfix/xxx
  2. Commit all fixes and changes to this branch
  3. Once finished, create a pull request into master (requires 2 approvals)

image

Deleting Branches

Once a feature, hotfix or release branch is merged that branch can and must be safely deleted.

What if I want to get someone's else merged changes

Say someone merged their changes into a branch after you created a new branch, and you want to access those changes. TO do that, you need to perform a rebase, which is essentially you saying "I want my branch to start from a different place". To rebase the branch my-branch to the latest changes in develop:

  1. Make sure that develop is up-to-date on your local machine (through a git pull)
  2. With my-branch checked out, run git rebase develop
  3. Run git push --force to update the rebase on GitHub

NOTE: While the force push seems scary, it is a requirement only when rebasing

Additional Resources

Below are some more resources on gitflow if you'd like to read more into it:

image

Clone this wiki locally