-
Notifications
You must be signed in to change notification settings - Fork 3
Git Rules
Cristian Aldea edited this page Mar 12, 2020
·
16 revisions
Table of Contents
- Branches
- Creating a New Branch
- Commit Messages
- Making a PR
- Keeping Commits Clean
- ZenHub User Story Template
- Bug Template
-
master
: Production-ready branch. Can only be merged to using the PR model. Onlydevelop
can be merged tomaster
. -
develop
: Development branch. Can only be merged to using the PR model. Only tasks, user stories, and bug branches can be merged todevelop
. -
TASK-#
: Task branches. Not all tasks need code to be edited, but if you do, please name it according to the Task number. -
US-#
: Feature branches. Used to develop new features for the project. Please name it according to the User Story number. -
BUG-#
: Used for bug fixing. Please name it according to the Bug number.
We will be basing all our branches from the develop
branch. Why not master? Because this way, you can pull all the other features that were not yet merged to master
, but exist in develop
.
- Go to your
develop
branch:
git checkout develop
- Pull all changes that were made:
git pull
- Create a new branch based off of
develop
:
git branch BRANCH-TYPE-#/Name-of-Branch
Ex: TASK-1/Ritchelle-PR
- Go to your new branch and start working from there:
git checkout BRANCH-TYPE-#
Ex: git checkout TASK-1/Ritchelle-PR
- All commits must start with a first line, which will be called the commit title
- The title must start with an action verb in present tense.
- The title must contain the issue number for the related issue, if applicable.
- The title should be under 50 characters (not necessary, but good practice).
- If you need to further explain details or reasoning behind your commit, include them in a body underneath the title. There must be an extra newline between the title and body of the commit.
Example commit message:
Update README.md #4
The README had outdated information, so it was changed
to reflect recent modifications to the code.
For further reading about good practices related to commit messages: https://chris.beams.io/posts/git-commit/
- Go to our main repo page and click on:
New pull request
. - Select your source branch to your destination branch (unless you're doing a PR from
develop
tomaster
, you're always going to merge todevelop
as your destination branch). - Set your PR description using this template:
Example PR description:
This PR references issue(s) #4
- Fix any merge conflicts.
- At least 1 teammate has to approve the PR before it gets merged.
- Once merged, close your GitHub issue.
Please ensure your commits are clean before your PR is merged. Remember that you must:
- Follow the commit template
- Squash your commits and keep only the necessary messages
- Only merge once the AC have been met
- The Team Lead and a Tech Lead need to have approved a PR.