Git Merge Confilct
2021-02-20 11:30:21 12 举报
AI智能生成
Git使用中关于代码冲突的处理方法和哲学
作者其他创作
大纲/内容
Git Merge Confilct
When
Try to merge
Try to rebase
Try to cherry-picking
Why
Git does not know which code to keep and which to discard.
Each branch only has the differences (the patch concept) from base to new version.
If two branches both modify the same region of a file. Notes: Not about same line only. It is about same region. So it could be around of the same line.
Core Concepts of Git
\"patch\" concept
A patch is a small text document containing a delta of changes between two different version of source tree.
Git is based on patch mechanism to track/manage all commits and merge actions.
Keep the version of code from Branch A
Keep the vesrion of code from Branch B
Keep both codes from Branch A and BNeed to combine/rewrite both logical in Branch A and B
Keep In Mind in Practice
!!! Need to 100% fully understand the changes in BOTH Branch A AND Branch B !!!Any Not-understood piece can cause the missing/failure on functionality while no compiling issue and/or error messages. And the issue can be hard to aware or find.
Raise the flag or ask original developer for help if having any unclear pieces
Add and Test the test cases which cover both Branch A and Branch B.
0 条评论
回复 删除
下一页