Common Branch Naming
Branches of the remote warehouse: main branch master
, development branch dev
, release branchrelease
Personal development branch: feature branch feature
, defect modification branch bugfix
, hot update branchhotfix
The general workflow is as follows
- Create a personal local development branch: git checkout -b feature/add_new_line origin/dev
- Push the personal local branch to the remote branch: git push origin feature/add_new_line:feature/add_new_line;
- Submit the MR of the personal remote code branch and the target code into the branch, and the relevant person in charge will perform CR
- The relevant person in charge makes an opinion, modifies the corresponding code locally, and pushes it to the corresponding remote code branch;
- After the code CR comments are processed, the relevant person in charge performs code merge, and the code modification is merged from feature/add_new_line into the dev branch to complete;
- delete the personal remote code branch;
miscellaneous
git push origin feature/mydev
Created a branch named feature/mydev in the remote warehouse
git push origin :feature/mydev_v1.0
Deleted remote branch for personal push
Example demonstration
Create a personal local development branch and switch to it:
Create a local branch named feature/add_new_line to track the dev branch of the remote warehouse origin
Then make development changes
Then submit to the remote personal development branch
You can see that there is an extra remote branch on github
then submitpull request
select pull requests
and clickNew pull request
Select feature/add_new_line
the code to merge the version code into the dev version, and clickCreate pull request
Click on the red box below
Then reviewers can choose to merge this pull request
Then you can see the corresponding modified content in the dev branch