0

I need understand how to do following in GIT. I have repository for one base project. I created a branch (kind of master) for new project. In the course of time, both the base project and new project has changed.

Now I need to merge specific changes or features from base project in new project and viceversa.

How can I do this with Git?

Here is my view on this scenario. Since both the base_project and new_project have parallel development going on, so a simple ff merge will either add additional change or overwrite existing one. So I will prefer to do cherry pick the stable versions from the source branch to target branch.

menem
  • 1
  • 3
  • From what you wrote, you need to have `new_project` branch equal to `base_project` branch. The code source will be exactly the same. Is that true ? If you merge `new_project` into `base_project` you will get exactly what you need. If not, it means I misunderstood your post. – Flows Jun 05 '16 at 13:36
  • yes the initial code of new project is same as one of the version of base project. Then during the course of time, both were independently developed. Now a feature F1 from base project needs to be merge in new project. But I need just the delta of feature F1 to be merged in new project. – menem Jun 05 '16 at 14:01
  • Could you show a picture of the git history, and the result expected. – Flows Jun 05 '16 at 14:14

1 Answers1

0
git checkout base_project
git merge new_project
git commit -am "new_project into base_project merge"

Or vice versa.

Awesim
  • 99
  • 9
  • Thanks for the answer. I wish to update specific features in base project to new project – menem Jun 05 '16 at 19:41