This is the fifth day of my participation in the August Wen Challenge.More challenges in August


GitFlow workflow

Vincent Driessen wrote A blog post entitled A successful Git Shoot Model. The Gitflow workflow is derived from this article.

The Gitflow workflow defines a strict branching model around project release. The distinguishing feature is that it assigns very clear roles to different branches and defines usage scenarios and usages. In addition to branches for feature development, it also uses separate branches for pre-release preparation, documentation, and post-release maintenance.



Branch is introduced

branch role
master Historical iteration branch
develop An active branch integrating newly developed features
f_xxx Feature development branch
b_xxx Bug fix branch
r_xxx Release Version sends packets branch


Preliminary process

Every company’s GitFlow workflow is different. We use the above GitFlow for a simple simulation

Familiarize yourself with how Git collaborates on projects.

git clone `url`

git checkout origin/dev	Switch to the remote branch

git branch -b dev		Create a local branch

git branch --set-upstream-to=origin/dev		Map local branches to remote branches
Copy the code


Make sure dev is up to date every time you write code to build a branch

git checkout dev

git pull
Copy the code


Finally, submit the Merge request

Create a new function branch and map it to remote
git checkout -b f_login
# git branch --set-upstream-to=origin/f_login

# Next, develop your own
git add xxx
git commit -m'xxxx'

git add xxx
git commit -m'xxxx'

# Submit to remote
# git push --set-upstream origin f_login
git push
Copy the code


Delete the functional branches that have been developed

git checkout dev 

git pull

git branch -d f_login

git branch -dr origin/login
Copy the code


Repeat the above steps with new development features

git checkout -b f_register
# git branch --set-upstream-to=origin/f_register

git add xxx
git commit -m'xxxx'

git push
Copy the code


Conflict resolution

Plan a

Resolve conflicts manually on Github


Scheme 2

# pull remote branch
git fetch origin develop

Compare the local current branch with the remote branch
git branch diff origin/develop 
Copy the code

Compare what’s different, what’s conflicting, make changes and resubmit

git add xxx
git commit -m'xxx'

git push
Copy the code


Plan 3

Add the conflicting files to the local branch and commit them to git commit -m'xxx'
git push


Copy the code


The tail language

✍ Code writes the world and makes life more interesting. ❤ ️

✍ thousands of rivers and mountains always love, ✍ go again. ❤ ️

✍ code word is not easy, but also hope you heroes support. ❤ ️