Branches
đ Branching Strategy
This repository uses a variation of the convention known as GitFlow. There are three main kinds of branches:
maindev- Feature branches
main Branch
- The
mainbranch is the primary branch of the repository. - It should only contain stable code. Ideally, the repository owner should merge code into this branch at the end of the project to prepare the next year's team.
dev Branch
- The
devbranch is for integrating feature branches into. - When a feature is complete, it is merged into the
devbranch.
Feature Branches
- Each new feature or bug fix should be developed in its own branch, created off the
devbranch. - Feature, bugfixes, etc. branches should be named according to the following convention:
feat/<name>fix/<name>.
Where <name> is a short, descriptive name of the feature or bug fix. If it is based off an issue, the name should start wth #<issue_number>. For example, feature/#1-add-login-page.
đ¨ Ground Rules
-
Never commit directly to the
mainbranch. -
Never commit directly to the
devbranch. -
Always create a new branch for each new feature or bug fix.
-
One person per branch. Each team member should work on their own branch. This ensures that there is safety in force pushing to the remote feature branch when necessary.
- The exception to this is any interactive live-collaboration in which two or more team members are communicating in real time to avoid commit/merge/rebase conflicts.
âšī¸ Basic Branching Commands
Create a New Branch
git checkout -b <branch_name>
Switch to a Branch
git checkout <branch_name>
List Branches
git branch
Delete a Branch
git branch -d <branch_name>