Git Rebase or Git Merge?

自作多情 提交于 2019-12-10 17:01:49

问题


I have two branches. Both are feature branches - new-ui and video-upload. video-upload is a fork of new-ui.

However, video-upload has a TON of commits. I have multiple developers working on new-ui, and one just completed video-upload. But I can't quite figure out which will be the cleaner option to combine the two.

I want to bring the completed work in video-upload into new-ui, but I don't know if I want to completely erase all the commits for video-upload and create a new commit history for new-ui with new commits. That feels like it will be messy.

But at the same time, I want a clean merge of the functionality.

Work has been done on new-ui since video-upload has been forked. So the merge/combination is not going to be clean.

Considering the above, which approach is best and why?


回答1:


Merge is exactly for that - shipping a version that includes development from two or more branches.

Rebase is for "rewriting history": to have a consolidated main trunk that includes commits from several branches but looks like a monotonic stream.



来源:https://stackoverflow.com/questions/32362647/git-rebase-or-git-merge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!