1. Git branch merge request conflict handling rules
1.1. Problem description
When submitting a branch merge request, a conflict occurs and the prompt is 此合并请求有变更与目标分支冲突
.
An example is shown in the figure:
1.2. Reasons
The merged target branch has already changed, such as code merged from other branches.
For example, there are two feature branches developed in parallel, the first feature branch has been merged into the develop branch, and the second feature branch is merged at this time, a conflict will arise.
1.3. Solutions (processing rules)
Merge the target branch into the current branch, and submit a branch merge request after resolving conflicts.
For example: merge the develop branch into the feature branch, and then submit a branch merge request.
1.4. VSCode operation example
1.4.1. Step 1: The current feature branch merges the code from the develop branch
Example of conflicting files after merging