marcamillion
marcamillion

Reputation: 33785

Git Rebase or Git Merge?

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?

Upvotes: 4

Views: 155

Answers (1)

epx
epx

Reputation: 1096

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.

Upvotes: 4

Related Questions