I have two forked git repositories, let's say repo1- git@github.com:vikasgope/project1.git repo2- git@github.com:vikasgope/project2.git repo2 is created from repo1 some months ago. Now me and some other developers worked on repo2 and modified some files into it, meanwhile some others developers also worked on repo1 and they have also modified some files into it.
Now I want that repo2 should have all changes done in repo1 as well as repo2. How can we merge the changes available in repo1 into repo2 with changes done in both repos (repo1 and repo2). And I have to preform this process time to time as have to take latest code from repo1 and put that into repo2.
FYI - Currently what I tried is
- git clone git@github.com:vikasgope/project1.git
- git remote add upstream git@github.com:<upstream_user>/project1.git
- git remote add project2 git@github.com:<upstream_user>/project2.git
- git fetch upstream
- git fetch project2
- git pull project2 master
But the problem with this is there are lot of files showing as conflicts Those files that are changed in repo1 only and not changed in repo2, also showing as conflicts.
Could anyone please help me out to do a efficient way, to merge all the change in repo1 to repo2 with all changes that done in repo2.