Skip to content

Commit bacfcf2

Browse files
committed
Update README.md
Signed-off-by: Ayush P Gupta <ayushpguptaapg@gmail.com>
1 parent 40dc773 commit bacfcf2

File tree

1 file changed

+70
-65
lines changed

1 file changed

+70
-65
lines changed

README.md

Lines changed: 70 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
![](img/001.png)
2-
FieldAssist
1+
### FieldAssist
32

4-
**VCS (Git) v2.0**
3+
# VCS (Git) v2.0
54

6-
Created: 15 Jan 21
7-
Updated: 16 Jan 21
5+
#### Created: 15 Jan 21
6+
#### Updated: 16 Jan 21
87

9-
Author: Ayush P Gupta [@apgapg](https://github.com/apgapg)
10-
Edited: --
8+
#### Author: Ayush P Gupta [@apgapg](https://github.com/apgapg)
9+
#### Edited: --
1110

12-
**OVERVIEW**
11+
12+
## OVERVIEW
1313

1414
Introduce the new proposed Git branching model for different FA project repositories.
1515

16-
**GOALS**
16+
## GOALS
1717

1818
1. Clean commit history
1919
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
2222
1. Make code more stable and prevent merge conflicts at PR review time and bugs in release
2323
1. Follow best practices as stated in this document
2424

25-
**BACKGROUND & MOTIVATION CURRENT SYSTEM**
25+
## BACKGROUND & MOTIVATION
26+
27+
### CURRENT SYSTEM
2628

2729
After rounds of discussions, following problems were found:
2830

2931
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
3537
7. With growing members in team the situation is becoming more worse leading to crashes and down of our publishes
3638

37-
**NEW SYSTEM**
39+
### NEW SYSTEM
3840

3941
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.
4042

4143
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
4547

46-
**OVERVIEW OF NEW SYSTEM![](img/002.png)**
48+
## OVERVIEW OF NEW SYSTEM
49+
50+
![](img/002.png)
4751

4852
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:
4953

50-
**master**
54+
### master
5155

5256
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:
5357

5458
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
5761
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.
6064

61-
**develop**
65+
### develop
6266

6367
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:
6468

6569
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.
6771

68-
**beta(release)**
72+
### beta(release)
6973

7074
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.
7175

7276
Here are some important points to remember:
7377

7478
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.
8084

81-
**hotfixes**
85+
### hotfixes
8286

8387
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.
8488

8589
Here are some important points to remember:
8690

8791
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.
9195

92-
**Team’s develop branches**
96+
### Team’s develop branches
9397

9498
These branches originate from develop branch for respective team workings. These can be referred to **develop branch** for individual teams.
9599

96-
**USE CASES**
100+
## USE CASES
97101

98-
**Scenario-1 : Start of sprint AA**
102+
### Scenario-1 : Start of sprint AA
99103

100104
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:
101105

@@ -117,19 +121,19 @@ develop-team-A
117121
```
118122

119123
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.
123127

124-
**Scenario-2 : Completion of sprint AA**
128+
### Scenario-2 : Completion of sprint AA
125129

126130
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.
127131
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
131135

132-
**Scenario-3 : Start of sprint BB**
136+
### Scenario-3 : Start of sprint BB
133137

134138
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:
135139

@@ -142,11 +146,11 @@ develop
142146

143147
And the process will continue, without hampering the previous sprint branches anywhere.
144148

145-
**Scenario-4 : Hotfixes**
149+
### Scenario-4 : Hotfixes
146150

147151
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:
148152

149-
1. **Hotfix Type 1 (Urgent Fix)**
153+
**1. Hotfix Type 1 (Urgent Fix)**
150154

151155
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.
152156

@@ -158,13 +162,13 @@ master
158162
-- hotfix/v2.x.y
159163
```
160164

161-
2. **Hotfix Type 2 (Bug Fix)**
165+
**2. Hotfix Type 2 (Bug Fix)**
162166

163167
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.
164168

165169
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).
166170

167-
**Merging Pull Request (PR)**
171+
### Merging Pull Request (PR)
168172

169173
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.**
170174

@@ -176,11 +180,12 @@ Hence all team members will use **Rebase and merge** option when merging PR of i
176180

177181
![](img/007.png)
178182

179-
**BEST PRACTICES**
183+
## BEST PRACTICES
184+
185+
### Branch Naming
180186

181-
**Branch Naming**
187+
Proper branch naming conventions must be used for development related work in team.
182188

183-
Proper branch naming conventions must be used for development related work in team.
184189
**[sprint-name] - [team name] - [work type] - [exact context]**
185190

186191
For example:
@@ -199,7 +204,7 @@ Looks awesome?
199204

200205
![](img/009.png)
201206

202-
**Commit Message**
207+
###Commit Message
203208

204209
Proper commit message should be entered while committing your work. Your commit message should follow following standards:
205210

@@ -210,14 +215,14 @@ Proper commit message should be entered while committing your work. Your commit
210215
This will clearly indicate what commit message corresponds to what feature/bug in commit history. Helpful after merge and releases are complete.
211216

212217
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.
214219

215-
**Release Commits**
220+
### Release Commits
216221

217222
Every merge to either **develop** or **master** must have the latest commit as **Release Commit.** This release commit comprises of two changes only:
218223

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.
221226

222227
```
223228
## [125.6.4] 14/01/21
@@ -243,7 +248,7 @@ Every merge to either **develop** or **master** must have the latest commit as *
243248
```
244249

245250

246-
**Rebase**
251+
### Rebase
247252

248253
**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.
249254

@@ -271,9 +276,9 @@ Sometimes code related or code review type discussions are needed with other mem
271276

272277
![](img/015.png)
273278

274-
**FURTHER READING**
279+
## FURTHER READING
275280

276281
1. <https://nvie.com/posts/a-successful-git-branching-model/>
277-
1. <https://travishorn.com/semantic-versioning-with-git-tags-1ef2d4aeede6>
278-
1. <https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow>
279-
1. <https://git-scm.com/book/en/v2/Git-Branching-Rebasing>
282+
2. <https://travishorn.com/semantic-versioning-with-git-tags-1ef2d4aeede6>
283+
3. <https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow>
284+
4. <https://git-scm.com/book/en/v2/Git-Branching-Rebasing>

0 commit comments

Comments
 (0)