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: README.md
+70-65Lines changed: 70 additions & 65 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,19 @@
1
-

2
-
FieldAssist
1
+
### FieldAssist
3
2
4
-
**VCS (Git) v2.0**
3
+
# VCS (Git) v2.0
5
4
6
-
Created: 15 Jan 21
7
-
Updated: 16 Jan 21
5
+
#### Created: 15 Jan 21
6
+
#### Updated: 16 Jan 21
8
7
9
-
Author: Ayush P Gupta [@apgapg](https://github.com/apgapg)
10
-
Edited: --
8
+
#### Author: Ayush P Gupta [@apgapg](https://github.com/apgapg)
9
+
#### Edited: --
11
10
12
-
**OVERVIEW**
11
+
12
+
## OVERVIEW
13
13
14
14
Introduce the new proposed Git branching model for different FA project repositories.
15
15
16
-
**GOALS**
16
+
## GOALS
17
17
18
18
1. Clean commit history
19
19
1. Hassle free Pull Request(PR) merging, reviewing and reverting
@@ -22,80 +22,84 @@ Introduce the new proposed Git branching model for different FA project reposito
22
22
1. Make code more stable and prevent merge conflicts at PR review time and bugs in release
23
23
1. Follow best practices as stated in this document
24
24
25
-
**BACKGROUND & MOTIVATION CURRENT SYSTEM**
25
+
## BACKGROUND & MOTIVATION
26
+
27
+
### CURRENT SYSTEM
26
28
27
29
After rounds of discussions, following problems were found:
28
30
29
31
1. Code commit history isn’t readable. One cannot go back and drill down about any feature, bug start/merge.
30
-
1. It was difficult to cherry pick due to multiple line history
31
-
1. Difficult to identify who did what work and when and how his/her work got merged.
32
-
1. Innumerous merge conflicts ultimately leading to difficulty in reviewing PR thereby leading to unstable code after merge
33
-
1. Lack of proper commit message leads to difficulty in purpose of commit/PR
34
-
1. Improper branch naming causes lack of understanding to other team members
32
+
2. It was difficult to cherry pick due to multiple line history
33
+
3. Difficult to identify who did what work and when and how his/her work got merged.
34
+
4. Innumerous merge conflicts ultimately leading to difficulty in reviewing PR thereby leading to unstable code after merge
35
+
5. Lack of proper commit message leads to difficulty in purpose of commit/PR
36
+
6. Improper branch naming causes lack of understanding to other team members
35
37
7. With growing members in team the situation is becoming more worse leading to crashes and down of our publishes
36
38
37
-
**NEW SYSTEM**
39
+
### NEW SYSTEM
38
40
39
41
Drilling down and after brainstorming we came with our new Git Branching model which solves most of the problems and provides more stable and reliable releases to our end users.
40
42
41
43
1. We see people using **merge** instead of **rebase.** Although one should wisely use both but sticking to only **merge** can cause non-linear commit history thereby reducing readability. Using **rebase** one can reduce the conflict scenario and can maintain linear history
42
-
1. When we have linear history it's easy to identify the work done by individuals and better track different bugs/features origin.
43
-
1. Linear history would enable us to cherry pick commits easily.
44
-
1. With proper commit message/branch naming standards we can easily identify the purpose of commit and subsequent PR
44
+
2. When we have linear history it's easy to identify the work done by individuals and better track different bugs/features origin.
45
+
3. Linear history would enable us to cherry pick commits easily.
46
+
4. With proper commit message/branch naming standards we can easily identify the purpose of commit and subsequent PR
45
47
46
-
**OVERVIEW OF NEW SYSTEM**
48
+
## OVERVIEW OF NEW SYSTEM
49
+
50
+

47
51
48
52
The new branching model is an enhanced version of [Git-flow](https://nvie.com/posts/a-successful-git-branching-model/) that tries to solve the previous diagnosed issues by defining different branches as below:
49
53
50
-
**master**
54
+
### master
51
55
52
56
Widely known, master(main) branch is the **most stable branch** that directly reflects the work on **production.** Since this branch is a reflection of production hence no member is directly allowed to work on it. Here are some important points to remember:
53
57
54
58
1. Master reflects the latest work on production/manage.
55
-
1. No direct commits/working on this branch is allowed.
56
-
1. No force push is allowed
59
+
2. No direct commits/working on this branch is allowed.
60
+
3. No force push is allowed
57
61
4. Can receive merge requests only from hotfix, release(beta) branch.
58
-
4. The commit just after merge commit **must be a release commit.**
59
-
4. This branch should not be merged into any other branch.
62
+
5. The commit just after merge commit **must be a release commit.**
63
+
6. This branch should not be merged into any other branch.
60
64
61
-
**develop**
65
+
### develop
62
66
63
67
The develop branch reflects the latest development work which is already tested by individuals. But being on the bleeding edge things can be broken. Here are some important points to remember:
64
68
65
69
1. No direct commits/working on this branch is allowed. Even admins should take out a branch and raise PR instead of directly commiting on this branch.
66
-
1. All the other development related branches must periodically rebase on this branch.
70
+
2. All the other development related branches must periodically rebase on this branch.
67
71
68
-
**beta(release)**
72
+
### beta(release)
69
73
70
74
These branches represent the beta environment or release branch. The idea here is to prepare for the next release that upon testing and passing QA will be merged into master.
71
75
72
76
Here are some important points to remember:
73
77
74
78
1. Must be taken out only from develop branch
75
-
1. No direct commits/working on this branch is allowed.
76
-
1. This branch must be kept in sync with the develop branch until this is merged.
77
-
1. Hotfixes branches also get merged into this branch.
78
-
1. After QA passing this branch will get merged into the master branch. Post which the branch existence will come to an end i.e. it will be deleted.
79
-
1. Any bug fixes detected in this branch must come from develop branch.
79
+
2. No direct commits/working on this branch is allowed.
80
+
3. This branch must be kept in sync with the develop branch until this is merged.
81
+
4. Hotfixes branches also get merged into this branch.
82
+
5. After QA passing this branch will get merged into the master branch. Post which the branch existence will come to an end i.e. it will be deleted.
83
+
6. Any bug fixes detected in this branch must come from develop branch.
80
84
81
-
**hotfixes**
85
+
### hotfixes
82
86
83
87
These branches represent the adhoc critical bug fixes that need to be fixed on master. These are short lived branches and must have minimum commits and fixes that are needed to prevent the critical bugs. Ideally no features must be included.
84
88
85
89
Here are some important points to remember:
86
90
87
91
1. Must originate from the master branch from its latest commit.
88
-
1. After work is done this branch must be merged to **master, beta(if any), develop.**
89
-
1. Must contain release commit before merging.
90
-
1. This branch must not be rebased or get rebased by any other branch. Must merge by no-ff option on develop.
92
+
2. After work is done this branch must be merged to **master, beta(if any), develop.**
93
+
3. Must contain release commit before merging.
94
+
4. This branch must not be rebased or get rebased by any other branch. Must merge by no-ff option on develop.
91
95
92
-
**Team’s develop branches**
96
+
### Team’s develop branches
93
97
94
98
These branches originate from develop branch for respective team workings. These can be referred to **develop branch** for individual teams.
95
99
96
-
**USE CASES**
100
+
## USE CASES
97
101
98
-
**Scenario-1 : Start of sprint AA**
102
+
### Scenario-1 : Start of sprint AA
99
103
100
104
Let’s say we currently have only two branches **master, develop**. There are new task assigned to different teams A, B, C. Here is how to proceed:
101
105
@@ -117,19 +121,19 @@ develop-team-A
117
121
```
118
122
119
123
3. After completion of work, one should rebase their branch on their team’s develop. This will make work to replay on top of the team's develop. Remember not to have any merge commit in your work. Finally raise PR on their team’s develop describing briefly about the work and other changes via PR template.
120
-
3. The team lead would review the PR and merge it via **rebase and merge(ff) option.** This will ensure no merge commits/conflicts are there and the linear history is preserved.
121
-
3. Upon completion of work on the individual team, the team would **rebase the team branch on-to develop**. This ensures all team work is replayed to the latest develop. Also this preserves linear history. Finally PR is raised to develop and get it merged.
122
-
3. The team lead must periodically rebase their **team’s develop branch on-to develop** and force push their branch.
124
+
4. The team lead would review the PR and merge it via **rebase and merge(ff) option.** This will ensure no merge commits/conflicts are there and the linear history is preserved.
125
+
5. Upon completion of work on the individual team, the team would **rebase the team branch on-to develop**. This ensures all team work is replayed to the latest develop. Also this preserves linear history. Finally PR is raised to develop and get it merged.
126
+
6. The team lead must periodically rebase their **team’s develop branch on-to develop** and force push their branch.
123
127
124
-
**Scenario-2 : Completion of sprint AA**
128
+
### Scenario-2 : Completion of sprint AA
125
129
126
130
1. The develop branch is now at the latest with all the changes from different teams, sprint. The admin would now take out a branch from latest develop and name it **release/sprint-AA.** This will now be manually published to the demo/beta environment and passed to the QA team for final testing.
127
131
2. Let’s say some bug crept in after QA analysis. The concerned team lead would then need to take out a branch from **develop** and raise PR to develop again after work is done/bugs fixed.
128
-
2. After final testing the release branch would then be **merged to the master branch and post that it is deleted.**
129
-
2. Once the release branch is merged to master, the respective team develop branch **is then deleted.**
130
-
2.**develop branch will not be updated with next sprint** changes until release branches are merged into master branch
132
+
3. After final testing the release branch would then be **merged to the master branch and post that it is deleted.**
133
+
4. Once the release branch is merged to master, the respective team develop branch **is then deleted.**
134
+
5.**develop branch will not be updated with next sprint** changes until release branches are merged into master branch
131
135
132
-
**Scenario-3 : Start of sprint BB**
136
+
### Scenario-3 : Start of sprint BB
133
137
134
138
We know the above release process may take a little time and meanwhile the next sprint can start. Hence in order to start the new sprint work, again the team lead will take out a new branch from develop:
135
139
@@ -142,11 +146,11 @@ develop
142
146
143
147
And the process will continue, without hampering the previous sprint branches anywhere.
144
148
145
-
**Scenario-4 : Hotfixes**
149
+
### Scenario-4 : Hotfixes
146
150
147
151
Consider that after the sprint has been released, some critical bug crept in which needs to be fixed urgently. We can classify these bugs into two categories:
148
152
149
-
1.**Hotfix Type 1 (Urgent Fix)**
153
+
**1. Hotfix Type 1 (Urgent Fix)**
150
154
151
155
These are critical and known bug which the admin thinks need to be tested by the team once fixed and he is confident in the fix.
152
156
@@ -158,13 +162,13 @@ master
158
162
-- hotfix/v2.x.y
159
163
```
160
164
161
-
2.**Hotfix Type 2 (Bug Fix)**
165
+
**2. Hotfix Type 2 (Bug Fix)**
162
166
163
167
These are similar to hotfix type 1 bugs but which need to be checked and passed by the QA team. The process of fix is similar to hotfix type 1 just to be approved by the team.
164
168
165
169
Once the bug is fixed on the particular hotfix branch, the admin would then need to merge it back into master and develop branch via no-ff merge in develop branch. Here the develop branch might have moved forward due to next sprint changes getting merged, but that won’t create issues as hotfix merging would create a merge commit (an exception to the rule of linear commit history).
166
170
167
-
**Merging Pull Request (PR)**
171
+
### Merging Pull Request (PR)
168
172
169
173
Pull request can be merged by admins in three ways (actually there are four, but we shall not describe squash commit technique). Either by **ff merge, no-ff merge, rebase and merge.**
170
174
@@ -176,11 +180,12 @@ Hence all team members will use **Rebase and merge** option when merging PR of i
176
180
177
181

178
182
179
-
**BEST PRACTICES**
183
+
## BEST PRACTICES
184
+
185
+
### Branch Naming
180
186
181
-
**Branch Naming**
187
+
Proper branch naming conventions must be used for development related work in team.
182
188
183
-
Proper branch naming conventions must be used for development related work in team.
Proper commit message should be entered while committing your work. Your commit message should follow following standards:
205
210
@@ -210,14 +215,14 @@ Proper commit message should be entered while committing your work. Your commit
210
215
This will clearly indicate what commit message corresponds to what feature/bug in commit history. Helpful after merge and releases are complete.
211
216
212
217
2. Commit messages must be **imperative**, like giving an order to do so and so thing.
213
-
2. Use present tense instead of past tense. Don’t use Added, Fixed instead use Add, Fix.
218
+
3. Use present tense instead of past tense. Don’t use Added, Fixed instead use Add, Fix.
214
219
215
-
**Release Commits**
220
+
### Release Commits
216
221
217
222
Every merge to either **develop** or **master** must have the latest commit as **Release Commit.** This release commit comprises of two changes only:
218
223
219
-
1.**Version Bump:** Increase in build version eg v2.5.4 to v2.5.5 or v2.6.0 in accordance with [semantic versioning](https://travishorn.com/semantic-versioning-with-git-tags-1ef2d4aeede6).
220
-
1.**Change log:** Updating corresponding CHANGELOG.md with what happened after the last commit message.
224
+
**1. Version Bump:** Increase in build version eg v2.5.4 to v2.5.5 or v2.6.0 in accordance with [semantic versioning](https://travishorn.com/semantic-versioning-with-git-tags-1ef2d4aeede6).
225
+
**2. Change log:** Updating corresponding CHANGELOG.md with what happened after the last commit message.
221
226
222
227
```
223
228
## [125.6.4] 14/01/21
@@ -243,7 +248,7 @@ Every merge to either **develop** or **master** must have the latest commit as *
243
248
```
244
249
245
250
246
-
**Rebase**
251
+
### Rebase
247
252
248
253
**Rebasing** is a process to reapply commits on top of another base trip. This must be done regularly or just before raising PR to the base branch.
249
254
@@ -271,9 +276,9 @@ Sometimes code related or code review type discussions are needed with other mem
0 commit comments