|
11 | 11 |
|
12 | 12 | ### Branching model
|
13 | 13 |
|
14 |
| -A Git branching model defines your [branching strategy](https://www.perforce.com/blog/vcs/best-branching-strategies-high-velocity-development) in Git. It determines when and how developers make changes and commit them back to your codebase. |
| 14 | +We follow a specific branching model to organize our development process. Please adhere to the following guidelines when creating branches: |
15 | 15 |
|
16 |
| -Using a Git branching model can expedite the process of delivering feedback to developers. [Git hosting](https://www.perforce.com/git-hosting) solutions don’t come with a branching model out of the box. These Git branching models are branching patterns designed to help overcome challenges. But with Git, you have to build it! |
| 16 | +### **Main Branches** |
17 | 17 |
|
18 |
| -### **Development branch** |
| 18 | +- **main**: The main branch is the production branch and represents the latest stable version of the project. |
| 19 | +- **dev**: The development branch where active development takes place. |
19 | 20 |
|
20 |
| -Usually the integration branch for feature work and is often the default branch or a named branch. For pull request workflows, the branch where new feature branches are targeted. |
| 21 | +### **Feature branches** |
21 | 22 |
|
22 |
| -- `dev` |
| 23 | +Feature branches should have one of the following prefixes: fix (bug fix), ft (feature), ht (hotfix), chore, or doc (documentation), followed by a forward slash and a descriptive name. |
23 | 24 |
|
24 |
| -### **Production branch** |
| 25 | +**Examples:** |
25 | 26 |
|
26 |
| -Used for deploying a release. Branches from, and merges back into, the development branch. In a Gitflow-based workflow it is used to prepare for a new production release. |
| 27 | +- ft/new-section-layout |
| 28 | +- fix/bug-fix |
| 29 | +- ht/emergency-fix |
| 30 | +- chore/update-dependencies |
| 31 | +- doc/update-readme |
27 | 32 |
|
28 |
| -- `main` |
| 33 | +### Commit |
29 | 34 |
|
30 |
| -### **Feature branch** |
| 35 | +- Adhere to the conventions outlined in [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) when crafting your commit messages. |
| 36 | +- Aim to produce mid-sized commits every couple of minutes or hours. However, prioritize logical consistency in your contributions. This entails breaking down extensive changes into multiple commits, ensuring each commit conveys an independent and meaningful purpose described in its commit message. |
31 | 37 |
|
32 |
| -Used for specific feature work or improvements. Generally branches from, and merges back into, the development branch, using pull requests. |
33 |
| -They should have the following prefix `ft/` |
| 38 | +#### Examples |
34 | 39 |
|
35 |
| -- `ft/{FEATURE_NAME}` |
| 40 | +1. **Following Conventional Commits:** |
36 | 41 |
|
37 |
| -### **Hotfix branch** |
| 42 | + ```bash |
| 43 | + git commit -m "feat: add new feature" |
| 44 | + git commit -m "fix: resolve issue with..." |
| 45 | + ``` |
38 | 46 |
|
39 |
| -Used to quickly fix a Production branch without interrupting changes in the development branch. In a Gitflow-based workflow, changes are usually merged into the production and development branches. |
40 |
| -They should have the following prefix `ht/` |
| 47 | +2. **Logical Consistency:** |
41 | 48 |
|
42 |
| -- `ht/{BUG_NAME}` |
| 49 | + - Break down changes logically. |
43 | 50 |
|
44 |
| -### **Bugfix** |
| 51 | + ```bash |
| 52 | + # Good practice |
| 53 | + git commit -m "chore: update dependencies" |
| 54 | + git commit -m "doc: improve documentation" |
45 | 55 |
|
46 |
| -This branch is used to fix bugs which might be more intensive when it comes to the amount of changes to be done. |
47 |
| -They should start with the prefix `bg/` |
| 56 | + # Avoid combining unrelated changes |
| 57 | + git commit -m "chore: update dependencies and fix bug" |
| 58 | + ``` |
48 | 59 |
|
49 |
| -- `bg/{BUG_NAME}` |
50 |
| - |
51 |
| -### **Release** |
52 |
| - |
53 |
| -Branch used for release tasks and long-term maintenance versions. They are branched from the development branch and then merged into the production branch. |
54 |
| -They should start with this prefix `rl/` |
55 |
| - |
56 |
| -- `rl/{VERSION}` |
57 |
| - |
58 |
| -### Commits |
59 |
| - |
60 |
| -- Follow this guideline [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for your commit messages |
61 |
| -- Try to create a mid-sized every couple of minutes/hours. But more importantly, try to let commits be logically consistent contributions. That means if you have many changes in lines of code you can split them up into multiple commits but each of those commits should have an independent meaning that is described by the commit message. |
| 60 | +By adhering to these guidelines, we maintain a clean and informative commit history. Please refer to the provided examples for a better understanding of the recommended practices. |
62 | 61 |
|
63 | 62 | ### PRs, Code Review
|
64 | 63 |
|
|
0 commit comments