0

I have a kind of a situation - There's a project that we've forked but the person who originally forked it did not really know how git works so he just created a new repository and copied the code. Unfortunately that was not caught in time and there are already many changes in both our fork and the original project (whose repository is read-only from our perspective). We'd like to reach a situation where we could cherry-pick some of those later changes from the original project into our fork (including changes made to the original project so far). I'm not too familiar with advanced git commands so I please forgive me if it's a stupid question.

Properly creating a new forked repo is perfectly fine and is our intention in the first place, it's only the original project's repo that we can't touch. I'm not exactly sure which was the last commit to the original project before the new repo was created but I have a few candidates.

Thank you!

Dan
  • 261
  • 2
  • 8
  • 1
    Does this answer your question? [Merge changes of copied repository without true common ancestor in git](https://stackoverflow.com/questions/38022096/merge-changes-of-copied-repository-without-true-common-ancestor-in-git) – padaleiana Oct 26 '20 at 09:57

1 Answers1

0

disclaimer : this is dangerous. Backup everything BEFORE.

I have been in the same situation and you can use git rebase to save the day. Look at this answer. It helped me a lot.

Sebastien
  • 51
  • 4
  • I'll try, though as I said I'll first try to find the common ancestor, since it's one of about 5 candidates. If I find it and git checkout by its sha1 does it make things easier? – Dan Oct 26 '20 at 19:31
  • I can make some tests to give you a more precise procedure. Do you kow at least which commit was the latest one when the copy was made ? – Sebastien Oct 27 '20 at 10:45