2

Here's the situation:

  1. In a repo, I made X changes to some files
  2. These same files were eventually moved to a different repo
  3. Y different changes were made, sometimes in places where I had made changes

I want to apply my X changes for these files in the different repo, and also keep the Y changes (while also resolving any conflicts that exist).

What's the best way to do this?

Kelli-Jean
  • 1,417
  • 11
  • 17

1 Answers1

1

If those files changes were done in one commit, you can use git format-patch to create and apply patch from one repo to another.

If not, you would need, file by file, to use git diff --no-prefix in order to make a patch you can apply to the other repo working tree.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • The changes were not done in a single commit. In addition, I just noticed the new repo doesn't have any of the old repo's commit history. So should I still move my files over to the new repo, and then use `git diff --no-prefix` on each file? – Kelli-Jean Jan 09 '18 at 21:31
  • @Kelli-Jean Yes, git diff --no-profix is still a good option even if the new repo does not have the full history. But you need to know what to 'git diff' against, meaning which commit of the old repo is similar to the current new repo state. – VonC Jan 09 '18 at 21:33