Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.6k views
in Technique[技术] by (71.8m points)

两个分支代码相差一年,git如何合并成最新代码?

分支B是去年从分支A拉出来的,到现在已经有一年了,这一年期间A和B分支各自都有开发改动,现在想把B merge回A,请问有什么快捷的方法吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

操作上,就是直接把 B往 A上 merge 就可以了.

如果这两个分支一年间的开发,都是各自功能,几乎不涉及到改动相同文件,那直接merge没啥问题.

否则,避免不了要解决冲突,这才是痛苦的开始,两个分支的人要能清楚的想起来每个冲突点是在干啥,最终是以那个版本为主,是选择一方合并还是要修改代码才能合并. 合并完了还有全回归测试,保证不影响现有的业务功能,还要保证 A,B 的功能都是正常的.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...