Git resolves conflicts
- Install beyond compare 4
2. Configure the GIT comparison tool
# Difftool Configuration
Git config -- Global diff. Tool bc4
Git config -- Global difftool. bc4.cmd "\" C:/program files/beyond compare 4/bcomp.exe \ "\" $ Local \ "\" $ Remote \""
Git difftool head // compare the current Modification
# Mergeftool Configuration
Git config -- Global merge. Tool bc4
Git config -- Global mergetool. bc4.cmd "\" C: /program files/beyond compare 4/bcomp.exe \ "\" $ Local \ "\" $ Remote \ "\" $ base \ "\" $ merged \""
Git config -- Global mergetool. bc4.trustexitcode true
# Prevent git mergetool from generating backup files (*. orig)
Git config -- Global mergetool. keepbackup false
- Job branch merge conflict resolution
1. Undo the task branch code on the target Branch
1) switch to the target Branch
Git checkout G4
Git pull
2) check whether the task branch code on the target Branch has been merged.
Git log-oneline-grep = "E00P00-123"
3) if the task has been merged, undo the task code and submit it.
Git revert-no-commit $ (GIT log-pretty = "% H"-grep = "E00P00-123 ")
Git commit-m "XXX E00P00-123 XXXXXXXXX # task code undo"
Skip this step if there are no merged or undo conflicts
2. Merge the task branches to the target branches.
Git merge-squash origin/E00P00-123
3. If a merge conflict exists, the conflict will be resolved.
1) view conflicting files
Git status
2) Open the merge tool.
Git mergetool
3) resolve the conflict after the BC interface appears
4. Submit the code after resolving the conflict
Git commit-M 'xxx E00P00-123 xxxxx"
- Push Branch
Git push
- Merge conflicts between integration branches, develop, and Master branches (take Integration Branch G3 and develop branch as an example)
1. Merge integration branches to develop
Git checkout develop
Git pull
Git merge-no-commit origin/G3
2. If there is a conflict, use the comparison tool to solve the conflict (same as the merge task branch solution)
Git mergetool
3. Submit the code after resolving the conflict.
Git commit-m "XXX E00P00-124 xxxxxx" (with the release task title as the commit log)
4. Push Branch
Git push
Git conflict resolution