Git development specification

GitDevelopment specification

In daily development, we often Gitdeal with, the server may be different, but the commands and specifications are basically the same.

1. Resident branch

The resident branch is a branch that should exist in the normal development and online process.

1.master/prod/production

The main branch, also known as the production environment branch, may sometimes be replaced by ( prod/ production). The deployment branch of the production environment and production environment-related operations, such as packaging, should be performed from the change branch.

2.dev

Full name (Develop), development branch, our normal demand development, etc., should use this branch. Use this branch for deployment and packaging of the development environment.

3.pre

The full name (Pre production), pre-production branch, generally depends on the project. Some projects may have no pre-production branch or pre-production branch due to insufficient resources and other reasons, but also an online test environment. Pre-production environment packaging should be done from this branch.

2. Temporary branch

Temporary branches, as the name suggests, will not be permanent. Generally merge, they will be deleted after the mission is completed.

1.feature

The development branch of the new requirement is developseparated from the branch. After the development is completed, you must merge to the develop branch. The naming of the function branch, which can be feature_*named (* is the requirement name spelling, such as feature_user_list)

2.hotfix

Bug fix branch. In order to fix a bug, it is separated from the resident branch. After the repair is complete, merge to the corresponding branch. The naming of the bug fix branch, which can be fixbug_*named (* is the description of the bug, such as fixbug_user_list)

3. Development process

1. Normal development

  1. devCut a new branch from the branch, and name it feature_*or according to whether it is a new feature or a bug fixbug_*.
  2. The developer completes the development and submits the branch to the remote warehouse.
  3. The developer initiates a mergerequest (available on the gitlab page New merge request), requests the new branch mergeto the developbranch, and reminds it to 代码检查人员proceed review.
  4. 代码检查人员Code reviewThereafter, if no problem, accepting mergethe request, the new branch mergeto developbranch, the new branch is also deleted; if the problem can not be performed merge, may be closethe request, notify the developer be adjusted in the new branch. After the adjustment, submit the code and repeat the reviewprocess.
  5. When transferring, directly from the current developbranch mergeto the prebranch, rebuild the test environment to complete the transfer.
  6. After the test is completed, from prebranch mergeto master/prodbranch, master/prodbuild a production environment based on the branch to complete the launch. And type the masterbranch tag, the tagname can be v1.0.0_2020.05.15.1(ie version number_online time)

2. Fix bugs during development

That is, the previous version has been transferred but not launched, and the latter version has been developed and partially merged into the devbranch. After the transfer, the test environment found that it bugneeds to be fixed, but the devbranch has new content at this time and this part of the content is not currently planned Transfer testing, you can precut out a bug fix branch. After completion, you need mergeto go to the prebranch and devbranch at the same time .

3. Bug fixes in the production environment

There are two types of bugs in the production environment:

  1. 紧急Bug: The bug that seriously affects the user's use is an emergency bug and needs to be repaired immediately. If there is a problem in a key business process, it affects the normal business behavior of users.
  2. 非紧急Bug或优化: A non-critical business process problem that only affects the user experience, or occurs less frequently, etc., is a non-emergency bug and can be planned to be fixed in a subsequent version.

Repair 紧急Bug: :
need from the mastercut branch out a bug fix branch, after completing the required simultaneously mergeto the masterbranch and devthe branch (if required test involves authentication, you can merge into the first prebranch, and then verified by mergethe masterbranch line).

Four. Flow chart

Insert picture description here

Guess you like

Origin blog.csdn.net/LitongZero/article/details/106188138