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
310 views
in Technique[技术] by (71.8m points)

git - How to do a clean merge to master with very different code

I have a master branch and a development branch that are merged. Now I did a major refactor on a develop_new branch and I'd like to merge it to the master. The problem is that the differences between developement and development_new are huge and if I merge it normally I'll have lots of unused files from the development inside the master.

What should be the correct approach assuming that I want to have in the master the history of the old commits?

One possible approach that I'm considering is to create a new branch from the master, let call it cleanUpBranch, delete all files and merge it with the master to delete everything, then merge the development_new. I believe this works but I'd like to know if there is any better approach.

I considered the rebase command but because I'd like to keep the history I don't think it's possible.


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

1 Answer

0 votes
by (71.8m points)
等待大神答复

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

...