Home > Development Tools > git > How git resolves conflicts

How git resolves conflicts

coldplay.xixi
Release: 2023-01-13 00:40:53
Original
53343 people have browsed it

Git method to resolve conflicts: first right-click on the project directory and click on the two-way red arrow; then select the conflicting file that needs to be modified and select merge tool; then merge the code; finally right-click again and select commit Submit code.

How git resolves conflicts

The operating environment of this article: Windows 7 system, git2.30.0 version, Dell G3 computer.

Git's method of resolving conflicts:

1. First, if there is a conflict in our file, the file will be displayed in red. Then we move the mouse to the project directory, right-click, and select the team column. This column is the attributes and processing methods of git. Then select the synchronize workspace, which is synchronize workspace

How git resolves conflicts

How git resolves conflicts

2. After that, we will enter the conflict resolution interface. Then we click on the position of the two-way red arrow, which means that all conflicting files are displayed. The purpose of this is to allow us to see file conflicts more intuitively.

How git resolves conflicts

#3. Then select the conflicting file we need to modify, then right-click and select merge tool, and then two code comparison interfaces will appear in the lower right corner. Remember that the code on the left is the latest code of the server, and the code on the right is your own code. At this time, you need to compare the server code and your code for any inconsistencies, then modify and save them on the left.

How git resolves conflicts

4. After saving, we select the conflict file and still right-click the mouse and select add to index to merge the code,

How git resolves conflicts

5. After merging, right-click again and select commit to submit the code. Note that this process will take a little longer when submitting the code again. After the submission is completed, we will find that the project will have an arrow to be pushed. When we see the arrow to be pushed, it means that the conflict has been resolved.

How git resolves conflicts

More learning recommendations: git tutorial

The above is the detailed content of How 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