Resolving code conflicts
If a commit appears, "You have to update your work copy a." Red warning, stating that this file in the version library has been modified by someone else.
Please click "OK" button to exit. Execute update, and then commit.
If the modification does not conflict with the code obtained by update, it is merged automatically.
If a conflict, such as a modification of the same line of code, occurs, the "one or more files are in a conflicted state" appears. Red warning, and produces several file record conflicts.
In general, we do not edit conflict files directly. Instead, resolve the conflict manually by following these steps.
In Explorer, select the file to which the commit conflicts, and the right mouse button selects "Edit conficts".
The interface is divided into "theirs", "Mine" and "merged" 3 parts, representing "Other people modified content", "I Modified Content" and "merged results" 3 parts. We are going to "don't
The contents of the person's modification "and" What I have modified are merged to form a "merged result".
The merger is generally divided into 4 different situations:
1. Keep "My Changes" and discard "other people's changes". Right-click the corresponding line of the mine box, click "Use this text block".
2. Discard "My Changes" and keep "other people's changes". Right-click the corresponding line of the theirs box, click "Use this text block".
3. Keep "My Changes" and "other people's changes" at the same time, and put "My changes" in the front. Right-click the corresponding line of the mine box, click "Use text blocks from mine before theirs".
4. Keep "My Changes" and "other people's changes" at the same time, and put "other people's changes" in the front. Right-click the corresponding line of the mine box, click "Use text blocks from theirs before mine".
Merge complete, Ctrl+s save, exit.
Then, in Explorer, select the conflict file, the right mouse button selects "Resolved", and the tag conflict is resolved. The file created by the conflict is automatically deleted.
At this point, you are ready to proceed with the commit operation.