Skip to content

Git Rules

Abdelrahman Khalifa edited this page Feb 2, 2024 · 5 revisions

Git Rules

Branches

  • main: Production specific branch. Merging can be done only using a pull request. Only development can be merged with main.
  • development Development branch. Merging can be done only using a pull request.
  • TASK-#number/name: Task branches, the number is the Task number of the related issue.
  • FEATURE/name: For adding a new feature that is not part of a task.
  • BUG-#number/name: Used to fix bugs, the number is the Task number of the related issue.
  • DOC/name: Used for changes to documentation that doesn't fall under any specific task.

New Branches

All new branches will be based on the development branch since it will always contain all features not yet merged into the main branch.

  1. Go to the development branch:
git checkout development
  1. Pull the current version of the branch:
git pull
  1. Create and switch to the new branch
git checkout -b TYPE-#number/name (Ex: TASK-#44/frontend-update-user-profile-icon)

Pull Requests:

  1. Go to the main repository, navigate to Pull requests section, and click on: New pull request
  2. Select the source and the destination branch (always push new features to development, only development can merge to main).
  3. If your poll request closes an issue name, use the following description This pull request closes #number.
  4. At least 1 team member needs to approve the poll request before it can be merged, for merging from development to main 2 team members' approval is a must before merging.
  5. Make sure to in case of disapproval of a pull request to comment down indicating the reasons, or if more clarification is requested.
  6. Don't merge to the main repository after the last meeting of the sprint.

Commit standard