How to make the diff of files generated by 2 git fast-exports into a patchable file

90 Views Asked by At

I have 2 repos, repo1 and repo2 each with just one branch such that the repos can be graphed as such:

repo 1: A --- B --- C

repo 2: A --- B --- C --- D --- E --- F

From here I want to run git fast-export --all > export1 on repo1 and git fast-export --all > export2 on repo2 so that I have two text files "export1" and "export2".

I then run git diff export1 export2 > diffs.patch to get the diffs from the git fast-export and in theory containing just information on commits, D --- E --- F.

How do I modify diffs.patch and what commands do I use so that I can apply the patch on an isolated repo3, which looks like this:

repo3: A --- B --- C --- G

so that it will look like this once the patch file is modified, emailed, and applied:

repo3-patched: A --- B --- C --- G --- D --- E --- F.

This MUST be done without using git bundle (can't use binary files) and git format-patch (I want to patch tags and branches as well, which to my knowledge, git format-patch cannot do).

0

There are 0 best solutions below