Git rules - dannylombardo/beetle_express-soen341projectW2024 GitHub Wiki

Git Rules


Table of Contents

Branches


  • main: Production-ready branch. Only code from code can be merged with main.
  • develop: Branch that contains all the preproduction code from the team members. Code from all other branches is merged with develop.
  • features: Branch containing all the new features to be added to the project.
  • bug: Branch that contains all bugs that have not been sorted out.

Creating a New Sub-Branch

All the branches in this project will be based on the develop branch. This is done because all the newest features will be located in develop before they are in main.

  1. Go to develop: git checkout develop
  2. Pull the latest changes: git pull
  3. Create a new branch based on develop: git branch BRANCH/Name-of-sub-branch Ex: Branch1/bug-1
  4. Go to the new branch: git checkout BRANCH Ex: git checkout Branch1/bug-1

Commit Messages


All commits must follow the conventional commits sepcification.

Making a Pull Request

  1. Go to the main page of the repo.
  2. Choose the branch that has your commits.
  3. Click on compare and pull request to create a pull request for the associated branch.
  4. Add a title and description for your pull request.

Keeping Commits Clean

Commits should only be done when a substantial amount of work has been done, i.e. a new function or class. Commits should not be overdone. Commits should be properly documented to allow others to understand what has been added or changed with that commit.


Pushing to the Main Branch

This is done when the code in 'develop' is working and the team agrees that the code is ready to be committed. The code in 'main' can be shipped so should be in working order and contain no bugs.