Skip to content

Commit 1ed876d

Browse files
docs: add numbered headings
1 parent bea5775 commit 1ed876d

File tree

1 file changed

+32
-25
lines changed

1 file changed

+32
-25
lines changed

coding-standards/git.md

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
# Git Standards Document
22

3+
## Introduction
4+
5+
This document outlines the standards and conventions for using Git within our company. Adhering to these standards ensures consistency, clarity, and efficiency in managing and collaborating on projects.
6+
7+
## Table of Contents
8+
39
- [Git Standards Document](#git-standards-document)
410
- [Introduction](#introduction)
5-
- [Git Configuration](#git-configuration)
6-
- [Repository Structure](#repository-structure)
7-
- [Commit Messages](#commit-messages)
11+
- [Table of Contents](#table-of-contents)
12+
- [1. Git Configuration](#1-git-configuration)
13+
- [2. Repository Structure](#2-repository-structure)
14+
- [3. Commit Messages](#3-commit-messages)
815
- [Commit Message Format](#commit-message-format)
916
- [Type](#type)
1017
- [Subject](#subject)
1118
- [Body](#body)
1219
- [Footer](#footer)
1320
- [Commit Message Samples](#commit-message-samples)
1421
- [Revert](#revert)
15-
- [Commit Granularity](#commit-granularity)
16-
- [Pull Requests (PRs)](#pull-requests-prs)
17-
- [Submitting a Pull Request (PR)](#submitting-a-pull-request-pr)
22+
- [4. Commit Granularity](#4-commit-granularity)
23+
- [5. Pull Requests (PRs)](#5-pull-requests-prs)
24+
- [6. Submitting a Pull Request (PR)](#6-submitting-a-pull-request-pr)
1825
- [After your pull request is merged](#after-your-pull-request-is-merged)
19-
- [Code Reviews](#code-reviews)
20-
- [Conflict Resolution](#conflict-resolution)
21-
- [Tagging and Releases](#tagging-and-releases)
26+
- [7. Code Reviews](#7-code-reviews)
27+
- [8. Conflict Resolution](#8-conflict-resolution)
28+
- [9. Tagging and Releases](#9-tagging-and-releases)
2229
- [Conclusion](#conclusion)
2330

24-
## Introduction
25-
26-
This document outlines the standards and conventions for using Git within our company. Adhering to these standards ensures consistency, clarity, and efficiency in managing and collaborating on projects.
27-
28-
## Git Configuration
31+
## 1. Git Configuration
2932

3033
- Username and Email: Ensure your Git configuration is set with your real name and work email.
3134

@@ -34,22 +37,26 @@ This document outlines the standards and conventions for using Git within our co
3437
git config --global user.email "your.email@company.com"
3538
```
3639

37-
## Repository Structure
40+
## 2. Repository Structure
3841

3942
- Main/Master Branch:
4043
- Try to have `main` branch instead of `master`.
4144
- The `main` branch should always be deployable.
4245
- All commits on `main` should be made through pull requests.
4346
- Development Branch:
4447
- Use a `development` or `dev` branch for integration and testing.
45-
- Set branch protection rules for `main` and `development` branches to restrict developers to push unverified changes and allow only maintainers to push/merge. Here is the quick read on how to set branch protection rules:
46-
- github: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/managing-a-branch-protection-rule
47-
- gitlab: https://docs.gitlab.com/ee/user/project/protected_branches.html
48+
- Branch Protection Rules:
49+
- Set branch protection rules for `main` and `development` branches to restrict developers to push unverified changes and allow only maintainers to push/merge.
50+
- Here is the quick read on how to set branch protection rules:
51+
- github: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/managing-a-branch-protection-rule
52+
- gitlab: https://docs.gitlab.com/ee/user/project/protected_branches.html
4853
- Feature Branches:
4954
- Create separate branches for individual features or bug fixes.
55+
- Accepted formats are using task `type` as prefix, forward slash `/`, followed by a short `kebab-case-description`.
5056
- Name them descriptively, e.g., `feature/user-authentication`, `bugfix/password-reset`.
57+
- Note: Some projects may use `task shortcode` as branch name instead. Consult the Project Manager for what format to follow.
5158

52-
## Commit Messages
59+
## 3. Commit Messages
5360

5461
- Write clear, concise, and descriptive commit messages.
5562
- Use the imperative mood ("add" instead of "added").
@@ -142,12 +149,12 @@ PINB-678: Fix textbox positioning
142149

143150
If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
144151

145-
## Commit Granularity
152+
## 4. Commit Granularity
146153

147154
- Make small, atomic commits that logically separate changes.
148155
- Avoid mixing unrelated changes in a single commit.
149156

150-
## Pull Requests (PRs)
157+
## 5. Pull Requests (PRs)
151158

152159
- Create PRs for merging changes into the `main` or `development` branches.
153160
- Ensure PRs are reviewed and approved by peers before merging.
@@ -176,7 +183,7 @@ If the commit reverts a previous commit, it should begin with `revert:`, followe
176183
177184
- To maintain a clean and organized commit history, use the "squash and merge" option when creating a Pull Request (PR) against the development branch.
178185
179-
## Submitting a Pull Request (PR)
186+
## 6. Submitting a Pull Request (PR)
180187
181188
Before you submit your Pull Request (PR) consider the following guidelines:
182189
@@ -247,19 +254,19 @@ from the main (upstream) repository:
247254
git pull --ff upstream main
248255
```
249256

250-
## Code Reviews
257+
## 7. Code Reviews
251258

252259
- Conduct code reviews for every PR to ensure code quality and consistency.
253260
- Address all feedback and comments before merging the PR.
254261
- If you have CI setup, then ensure that CI passes before merging the PR.
255262

256-
## Conflict Resolution
263+
## 8. Conflict Resolution
257264

258265
- Resolve merge conflicts promptly.
259266
- Ensure conflicts are resolved locally before pushing changes.
260267
- Ensure that you test your changes locally after resolving conflicts.
261268

262-
## Tagging and Releases
269+
## 9. Tagging and Releases
263270

264271
- Use semantic versioning for your projects.
265272
- Create a tag for each release.

0 commit comments

Comments
 (0)