git workflow practice

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

  1. Create a personal local development branch: git checkout -b feature/add_new_line origin/dev
  2. Push the personal local branch to the remote branch: git push origin feature/add_new_line:feature/add_new_line;
  3. 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
  4. The relevant person in charge makes an opinion, modifies the corresponding code locally, and pushes it to the corresponding remote code branch;
  5. 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;
  6. 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

insert image description here

Then make development changes

insert image description here

Then submit to the remote personal development branch

insert image description here

You can see that there is an extra remote branch on github

insert image description here

then submitpull request

insert image description here

select pull requestsand clickNew pull request

insert image description here

Select feature/add_new_line the code to merge the version code into the dev version, and clickCreate pull request

insert image description here

Click on the red box below

insert image description here

Then reviewers can choose to merge this pull request

insert image description here

Then you can see the corresponding modified content in the dev branch

insert image description here

Guess you like

Origin blog.csdn.net/qq_42120843/article/details/130970737