Four ways: 1. Use "git fetch origin master" to pull down the remote branch; 2. Execute commands to manually merge conflicting content; 3. Use "git add xxx" and "git commit -m .." to submit the changes; 4. Execute the command to submit the changes to the remote branch.
The operating environment of this tutorial: Windows 10 system, Dell G3 computer.
Causes of git conflicts
Multiple developers use or operate the same file in git at the same time. Finally, when committing and pushing in sequence, the first An operation can be submitted normally, but when subsequent developers want to perform pull and pull operations, a conflict exception will be reported.
Git conflict resolution method
1. Use git fetch origin master
Pull down the remote branch
2. Use git merge origin master
Manually merge conflicting content. First merge the code and enter the remark information, then press esc, then shit;
, enter wq to save and exit
3. Use git add xxx and git commit -m "xxx"
to submit the changes
4. Use git push origin master
to submit the changes to the remote branch
Recommended (free): git
The above is the detailed content of What are the four ways git resolves conflicts?. For more information, please follow other related articles on the PHP Chinese website!