Column catalog
- Independent scenario development (isolation)
- The scene is introduced
- Scenario shown in figure
- Git Command Flow
- Merge scenario development (non-isolated)
- The scene is introduced
- Scenario shown in figure
- Git Command Flow
- Commonly used submission specifications
- Submission Information specification
- Submit identification Specification
Column details
Independent scenario development (isolation)
The scene is introduced
Mutual pollution, independent development can avoid code is code content on their branches, in the process of independent development, this is the best way to everyone in the development of branch and myself responsible for submit code modules, disadvantages are obvious, if need to schedule another development function of the block of code, You need to create new branches after the merge to test, and finally consolidate the developed functional blocks into a merge repository (Dev). This repository will be your test merge repository, and all the code will be in this repository. When the test is complete and the release requirements are met, The release version number of the code from the merge repository (dev) is transferred to the master repository (Master) so that the commit is made.
Scenario shown in figure
Git Command Flow
Prepare to synchronize the local development branch code to the remote repository and generate a version commit
# Submit native code
>>> git add -A
>>> git commit -m 'commit message'
# or
>>> git commit -am 'commit message'
# Local repository synchronization to personal remote repository branch (can ignore merge process)
>>> Git push [name of remote repository]# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- a branch merge to remote dev requests -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Git init in an empty folder and connect to the remote repository.
# Pull remote master branch to local master branch
>>> Git checkout -b master /master# pull remote dev branch to local dev branch
>>> Git checkout -b dev /dev# Remote branch A/B/C synchronizes to local branch A/B/C
>>> Git checkout -b [git checkout -b] [git checkout -b]>>> Git checkout -b = git checkout -b = git checkout -b = git checkout -b>>> Git checkout -b [local branch name]/[remote branch name]Merge to local dev branch (conflicts can be resolved manually)
>>> git checkout dev
>>> Git merge [local branch name -a]>>> Git merge [local branch name -b]>>> Git merge [local branch name -c]# dev branch code pushed to remote dev branch, merge completed
>>> Git push [remote repository name] dev# ------------------- Release version push -------------------
# Merge local dev branch into local master branch without any commit information
To ensure that only the version number is committed on the master branch
>>> git checkout master
>>> git merge --squash dev
>>> git add -A
>>> git commit -m 'Version: 10.2.4 release date: December 01, 2019 '
>>> Git push [remote repository name] masterCopy the code
Merge scenario development (non-isolated)
The scene is introduced
After this control model to facilitate will modify the code merge in the local test, also facilitate scheduling others block of code that encapsulate functional function, etc., but in people development at the same time, with the same file modification, extremely easy to cause merge conflicts, need to manually resolve the conflicts and submit changes, the advantages and disadvantages, tailored.
Scenario shown in figure
Git Command Flow
Prepare to synchronize the local development branch code to the remote repository and generate a version commit
# Commit the local dev code
>>> git add -A
>>> git commit -m 'commit message'
# or
>>> git commit -am 'commit message'
Merge the remote dev repository to the local master, manually resolve the conflicting files when merging
>>> git checkout master
>>> Git pull [name of remote repository] dev>>> git merge dev
# Local repository commit for the merged master
>>> git commit -am 'commit massage'
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- a branch merge to remote dev requests -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# push local master branch to remote dev branch
>>> Git push [remote repository name] dev# ------------------- Release version push -------------------
Create a new branch and associate it with the remote master branch.
>>> Git checkout -b [new branch]/master# Merge local master branch into new branch without any commit information
To ensure that only the version number is committed on the master branch
>>> Git checkout [new branch]>>> git merge --squash master
>>> git add -A
>>> git commit -m 'Version: 10.2.4 release date: December 01, 2019 '
>>> Git push [remote repository name] masterCopy the code
Commonly used submission specifications
Submission Information specification
Git commit -m '[commit id] description 'Copy the code
Submit identification Specification
Identify content | Identify description |
---|---|
FEAT | New features |
FIX | Fix the bug |
DOCS | Modify the document |
REFACTOR | Code refactoring, no new features and bug fixes |
BUILD | Changes to the build process, new dependencies, tools, etc. (e.g. webPack changes) |
STYLE | Only whitespace, indentation, and so on are modified, without changing the code logic |
PERF | Improved performance and presentation modifications |
CHORE | Non-src and test modifications |
TEST | Modification of test cases |
CI | Automatic process configuration modification |
REVERT | Roll back to the previous version |
INIT | Initialize the project |
MERGE | Merge conflicting branches |
DELETE | Delete operation |