1. 工具

git idea merge conflict

Generally speaking, Idea will fix merge conflict by offering a visual window which shows the differences between two files for user, who can then resolve conflicts easily. However, there could be exceptions.

In this situation,we have to follow git instructions.

Git is so smart, it offers lots of tips for us to deal with every problem.

The procedure is shown below, let’s take it for example. In three steps.

git status -> git rm -> git commit

allencheungdeMacBook-Pro:data-devwork allen$ git status
On branch feature/ckPartitionReplace_zhh_0507
Your branch is up to date with ‘origin/feature/ckPartitionReplace_zhh_0507’.

You have unmerged paths.
(fix conflicts and run “git commit”)
(use "git merge --abort" to abort the merge)

Changes to be committed:
deleted: devwork-common/src/main/java/com/xxx/data/devwork/client/MetaCheck2Client.java

Unmerged paths:
(use "git rm …" to mark resolution)
both deleted: data-devwork/devwork-test/src/main/java/com/xxx/data/devwork/entity/DqcRuleTemplateRel.java
both deleted: data-devwork/devwork-test/src/main/resources/mapper/devwork/DqcMapper.xml

allencheungdeMacBook-Pro:data-devwork allen$ git rm data-devwork/devwork-test/src/main/java/com/xxx/data/devwork/entity/DqcRuleTemplateRel.java
rm ‘data-devwork/devwork-test/src/main/java/com/xxx/data/devwork/entity/DqcRuleTemplateRel.java’
allencheungdeMacBook-Pro:data-devwork allen$ git rm data-devwork/devwork-test/src/main/resources/mapper/devwork/DqcMapper.xml
rm ‘data-devwork/devwork-test/src/main/resources/mapper/devwork/DqcMapper.xml’

allencheungdeMacBook-Pro:data-devwork allen$ git status
On branch feature/ckPartitionReplace_zhh_0507
Your branch is up to date with ‘origin/feature/ckPartitionReplace_zhh_0507’.

All conflicts fixed but you are still merging.
(use "git commit" to conclude merge)

Changes to be committed:
deleted: devwork-common/src/main/java/com/xxx/data/devwork/client/MetaCheck2Client.java

allencheungdeMacBook-Pro:data-devwork allen$ git commit
[feature/ckPartitionReplace_zhh_0507 49716dc] Merge branch ‘master’ into feature/ckPartitionReplace_zhh_0507

Comments to: git idea merge conflict

Your email address will not be published. Required fields are marked *