Home > Development Tools > git > What are the four ways git resolves conflicts?

What are the four ways git resolves conflicts?

青灯夜游
Release: 2023-01-29 16:44:19
Original
29188 people have browsed it

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.

What are the four ways git resolves conflicts?

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 masterPull down the remote branch

2. Use git merge origin masterManually 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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template