I\'m working on a Git repo that\'s been pulled from an SVN repo using git svn. Many moons ago, the SVN repo was created from a source tarball of the original (u
I had to do something very similar once, wasn't pretty but it was manageable. What I ended up doing was:
git format-patch --stdout > patches-for-upstream.mbox
$EDITOR patches-for-upstream.mbox
Inside the editor, I looked at which bits were common and needed changed to make "git am" do what I wanted. That turned out to be three lines, per file committed in each commit:
diff --git a/path/to/file b/path/to/file--- a/path/to/file+++ b/path/to/fileWhat the editor needs to do at this point is to go through these kind of lines and make the changes that you know are necessary to have all the patches apply to the other Git repository.
I did that in Vim, using three quickly typed macroes, YMMV. Something along the lines of:
diff --git a/ab/ (forward to next space from the a file, then /)---)a/+++)b/Repeat until the file's done. In Vim it was a matter of getting it in a macro once (qq), trying it out once (@q) and then doing it for the whole file (999@q).
Save the file, go in the other Git repo, and try to git am it.