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

What are the four ways git resolves conflicts?

青灯夜游
青灯夜游Original
2021-06-25 14:50:4529100browse

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!

Statement:
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