Home  >  Article  >  Development Tools  >  Introducing the three working methods of Git and Git workflow demonstration

Introducing the three working methods of Git and Git workflow demonstration

coldplay.xixi
coldplay.xixiforward
2021-02-25 10:28:473100browse

Introducing the three working methods of Git and Git workflow demonstration

Recommended (free): Git Tutorial

##Article Directory

    Centralized workflow (not commonly used)
  • Forking workflow (occasionally used)
  • GitFlow workflow (most popular)
  • Git workflow demonstration

There are three ways to use

Git during project development, namely centralized workflow and Git Flow workflow , Forking Workflow. The following mainly explains the Git workflow.

Centralized workflow (not commonly used)

Centralized workflow, like

SVN, uses the central warehouse as the single point for all modifications to the project entity. All changes are submitted to the Master branch. The main difference between this method and SVN is that developers have local libraries, but many features of Git are not used.
Introducing the three working methods of Git and Git workflow demonstration

Forking workflow (occasionally used)

Forking workflow is based on GitFlow and makes full use of Git's

Fork and pull request functions to achieve the purpose of code review. It is more suitable for developers who can manage large teams safely and reliably, and can accept submissions from untrusted contributors. (It is mainly used to review the code of members outside the team, and Linux virtual teams use it more).

Occasionally, we may use it if we need members outside the team to help us solve problems.


Introducing the three working methods of Git and Git workflow demonstration

GitFlow workflow (most popular)

Gitflow Workflows are established for feature development, release preparation, and maintenance Independent branches are created to make the release iteration process smoother and make full use of the characteristics of branches. The strict branching model also provides some much needed structure for large projects. The following picture is a complete development method diagram, but the actual development may be more streamlined:
Introducing the three working methods of Git and Git workflow demonstration

Git workflow demonstration

Demonstration instructions:
Introducing the three working methods of Git and Git workflow demonstration


Create a branch in Eclipse and name it

featureA branch:
Introducing the three working methods of Git and Git workflow demonstration Newbies in featureA branch After completing function A, submit it to the local library:

Introducing the three working methods of Git and Git workflow demonstration and then push to the remote library:

Introducing the three working methods of Git and Git workflow demonstration Next, the veteran programmer pulls the project:

Introducing the three working methods of Git and Git workflow demonstration After pulling, switch from the master branch to the FeatureA branch. At this time, you can see the novice’s modifications:

Introducing the three working methods of Git and Git workflow demonstration

Next, add FeatureA Merge the branch with the master branch locally and then submit it to the remote library:

First switch to the master branch → perform merge → push to the remote library


Introducing the three working methods of Git and Git workflow demonstration

Introducing the three working methods of Git and Git workflow demonstration

The above is the detailed content of Introducing the three working methods of Git and Git workflow demonstration. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete