0

I have a long going git project which havn't had commits for long time. Then a new developer got a checkout and created a new git init with those files, and start committing stuff.

How is it possible to merge and keep his commit log into the original repository?

It seems a bit hard when it does not share any commit.

I have tried to add the new project into a new remote branch, and then merge and rebase, but no log. It does gives conflicts because files are added in the init commit of the new project.

Update:

So it kind of works, if I take cherry pick commits other that the new initial commits. However, the initial commit was done directly on prod server, which might have changes for the old repo version. So I need to create a commit first with those changes.

Git history of new init

Jesper Grann Laursen
  • 2,357
  • 1
  • 20
  • 21
  • Show what you tried. Setting up one as a remote is the expected procedure. If it failed, you have to be very detailed. – Mad Physicist Jul 28 '18 at 07:06
  • 1
    What if you ignore his initial commit, and `git cherry-pick` his second commit? Does that work? If so, can you just cherry pick all his commits after the first one? – John Zwinck Jul 28 '18 at 09:14
  • 1
    Possible duplicate of [Connect git historys after cut](https://stackoverflow.com/questions/51532479/connect-git-historys-after-cut) – Timothy Truckle Jul 28 '18 at 09:43
  • Possible duplicate of [How do I clone into a non-empty directory?](https://stackoverflow.com/questions/2411031/how-do-i-clone-into-a-non-empty-directory) – phd Jul 28 '18 at 14:08

0 Answers0