GitFlow learning:
Learn this first: Click to open the link
Gitflow
Workflow is a classic model that embodies the experience and essence of workflow. Feel the thoughtfulness and power of this workflow as the project process complicates.
///////////////////////////////////////////////////////////////////////////////////////////////
Once git-flow is installed, you will have some extended commands. These commands automatically perform several actions in a predefined sequence.
git-flow is not meant to replace Git, it's just a very clever and efficient combination of standard Git commands in scripts.
Strictly speaking, you don't need to install anything special to use the git-flow workflow. You just need to know which workflows are made up of which individual tasks, with the right parameters, and simply execute those corresponding Git commands in the right order. Of course, it's more convenient if you use the git-flow script, and you don't need to keep all these commands and sequences in your head.
Install git-flow
Many different installation methods have emerged in recent years. In this chapter we'll use the most popular one: click-to-open links .
For details on installing git-flow, please read the documentation below and click the link to open it .
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
After talking for so long, there is no git command yet, so let everyone feel it (thanks to Bugly for finishing):
1). First pull the remote code to the local
git clone xxx
git checkout -b develop origin/develop
2). Create a new feature branch
git checkout -b feature
3). Multiple people are developing on the feature. If the development changes need to be incorporated into the feature in the middle, everyone needs to submit the local code changes to the remote
git fetch origin
git rebase origin/feature
git push origin feature
Then the person in charge of the feature rebases the develop branch, deletes the original feature branch, and re-creates the feature branch;
git fetch origin
git rebase origin/feature
git rebase develop
git push origin :feature
git push origin feature
This ensures that the feature keeps changing linearly;
4). After the feature development is completed, everyone needs to submit the local code changes to the remote
git fetch origin
git rebase origin/feature
git push origin feature
Then the person in charge of the feature rebases the develop branch, then merges the feature branch into develop, and deletes the feature;
git fetch origin
git rebase origin/feature
git rebase develop
git checkout develop
git merge feature
git push origin :feature
This can ensure that the development maintains linear changes, and the changes of each feature are completely traceable;
5). After the feature is merged, the corresponding release/feature branch is pulled out, and subsequent bug fixes are on the release/feature.
git checkout develop
git checkout -b release/feature
The synchronous merge of the release/feature branch is the same as the feature branch
6). After the release/feature branch bug is fixed, pull the corresponding tag and push it to the remote for release
git tag -a v1.0 -m 'feature发布'
git push origin v1.0
Then merge release/feature into the develop branch and delete it
git rebase develop
git checkout develop
git merge release/feature
git push origin :release/feature
7). After the release is completed, merge the release into the master branch to ensure that the master is the latest stable version (the actual operation is to initiate a merge request)
Ref:
https://www.git-tower.com/learn/git/ebook/cn/command-line/advanced-topics/git-flow