Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had to do something very similar once, wasn't pretty but it was manageable. What I ended up doing was:</p> <pre><code>git format-patch &lt;commitish&gt; --stdout &gt; patches-for-upstream.mbox $EDITOR patches-for-upstream.mbox </code></pre> <p>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:</p> <ul> <li>the line starting with <code>diff --git a/path/to/file b/path/to/file</code></li> <li>the line starting with <code>--- a/path/to/file</code></li> <li>the line starting with <code>+++ b/path/to/file</code></li> </ul> <p>What 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.</p> <p>I did that in Vim, using three quickly typed macroes, YMMV. Something along the lines of:</p> <ul> <li>go to next line starting with <code>diff --git a/</code></li> <li>go forward to that slash after the <code>a</code></li> <li>change the path as you need it to be</li> <li>go forward to the slash after the <code>b/</code> (forward to next space from the <code>a</code> file, then <code>/</code>)</li> <li>change the path in the same way as a</li> <li>next line (the <code>---</code>)</li> <li>go forward to <code>a/</code></li> <li>change the path</li> <li>next line (the <code>+++</code>)</li> <li>go forward to <code>b/</code></li> <li>change the path</li> </ul> <p>Repeat until the file's done. In Vim it was a matter of getting it in a macro once (<code>qq&lt;long string of commands&gt;q</code>), trying it out once (<code>@q</code>) and then doing it for the whole file (<code>999@q</code>).</p> <p>Save the file, go in the other Git repo, and try to <code>git am</code> it.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload