You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: coding-standards/git.md
+32-25Lines changed: 32 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,31 +1,34 @@
1
1
# Git Standards Document
2
2
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.
-[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)
18
25
-[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)
22
29
-[Conclusion](#conclusion)
23
30
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
29
32
30
33
- Username and Email: Ensure your Git configuration is set with your real name and work email.
31
34
@@ -34,22 +37,26 @@ This document outlines the standards and conventions for using Git within our co
- All commits on `main` should be made through pull requests.
43
46
- Development Branch:
44
47
- 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:
- 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:
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.
144
151
145
-
## Commit Granularity
152
+
## 4. Commit Granularity
146
153
147
154
- Make small, atomic commits that logically separate changes.
148
155
- Avoid mixing unrelated changes in a single commit.
149
156
150
-
## Pull Requests (PRs)
157
+
## 5. Pull Requests (PRs)
151
158
152
159
- Create PRs for merging changes into the `main` or `development` branches.
153
160
- 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
176
183
177
184
- To maintain a clean and organized commit history, use the "squash and merge" option when creating a Pull Request (PR) against the development branch.
178
185
179
-
## Submitting a Pull Request (PR)
186
+
## 6. Submitting a Pull Request (PR)
180
187
181
188
Before you submit your Pull Request (PR) consider the following guidelines:
182
189
@@ -247,19 +254,19 @@ from the main (upstream) repository:
247
254
git pull --ff upstream main
248
255
```
249
256
250
-
## Code Reviews
257
+
## 7. Code Reviews
251
258
252
259
- Conduct code reviews for every PR to ensure code quality and consistency.
253
260
- Address all feedback and comments before merging the PR.
254
261
- If you have CI setup, then ensure that CI passes before merging the PR.
255
262
256
-
## Conflict Resolution
263
+
## 8. Conflict Resolution
257
264
258
265
- Resolve merge conflicts promptly.
259
266
- Ensure conflicts are resolved locally before pushing changes.
260
267
- Ensure that you test your changes locally after resolving conflicts.
0 commit comments