Git
Development specification
In daily development, we often
Git
deal 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 develop
separated 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
dev
Cut a new branch from the branch, and name itfeature_*
or according to whether it is a new feature or a bugfixbug_*
.- The developer completes the development and submits the branch to the remote warehouse.
- The developer initiates a
merge
request (available on the gitlab pageNew merge request
), requests the new branchmerge
to thedevelop
branch, and reminds it to代码检查人员
proceedreview
. 代码检查人员
Codereview
Thereafter, if no problem, acceptingmerge
the request, the new branchmerge
todevelop
branch, the new branch is also deleted; if the problem can not be performedmerge
, may beclose
the request, notify the developer be adjusted in the new branch. After the adjustment, submit the code and repeat thereview
process.- When transferring, directly from the current
develop
branchmerge
to thepre
branch, rebuild the test environment to complete the transfer. - After the test is completed, from
pre
branchmerge
tomaster/prod
branch,master/prod
build a production environment based on the branch to complete the launch. And type themaster
branchtag
, thetag
name can bev1.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 dev
branch. After the transfer, the test environment found that it bug
needs to be fixed, but the dev
branch has new content at this time and this part of the content is not currently planned Transfer testing, you can pre
cut out a bug fix branch. After completion, you need merge
to go to the pre
branch and dev
branch at the same time .
3. Bug fixes in the production environment
There are two types of bugs in the production environment:
紧急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.非紧急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 master
cut branch out a bug fix branch, after completing the required simultaneously merge
to the master
branch and dev
the branch (if required test involves authentication, you can merge into the first pre
branch, and then verified by merge
the master
branch line).