Git project version management

foreword

At present, our projects basically use Git as a version control tool. The biggest highlight of Git is its branching feature, so here we mainly introduce the branch management of the project.
There are also many Git Flow best practices on the Internet, but we are not going to copy them here, just use them as a reference.

resident branch

  • Release
    branch: When it is ready for online release, the branch is checked out from the Master for the first time, and then merged from the Master.

  • Master
    stable branch: After professional testing by testers, the test branch is merged.
    This can also be used as a pre-release branch, and it needs to be tested here and then returned to verify before release.

  • test
    branch: After the developer submits the code and passes the self-test, it is merged from the dev branch.

  • dev
    development branch: as the branch where developers mainly submit code, including functional code, bug fix code, project refactoring, unit testing, etc.

temporary branch

  • Hotfix-xxx
    emergency bug fix branch: When an urgent and important bug is found on the Release line and needs to be dealt with, the branch will be checked out from the Release branch, and merged back to Release to release the patch version after repairing.
    After that, submit cherry-pick of the patch to dev, and then merge into test and master from dev, and finally delete the branch.

  • Bugfix-xxx
    important bug fix branch: When an important bug is found on the Master and Release, but it is not urgent for the Release, a Bugfix branch needs to be created on the Master branch.
    After the code is submitted in this branch and the test passes, the branch is merged into master, cherry-pick to dev, and finally the branch is deleted.

If it is an unimportant bug, you can submit the repair code directly on dev, and then merge it step by step.
However, the Bugfix branch here must also be paid attention, because after development self-test and professional verification of testing, problems still occur. It can't simply be combined step by step directly on the dev.
Being a stable branch requires quality assurance.
It should also be noted that in order to reduce the complexity, the feature branch is not used.

Simple schematic diagram of resident branch

Gitflow

follow-up

There are some things here that have not been explained in detail. I will write another article on how to deal with temporary branches in detail later.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325957589&siteId=291194637