How to apply git patch on repository with changed history?
<p>Recently i migradted from SVN to git and my team already started to work in fresh git repository.</p>

<p>Later i discovered some problems with conversion and made the 2nd git repo from SVN with some fixes and history rewrites. </p>

<p>Now i have 2nd git copy of SVN repo (whicn i am satisdied with) and i want to patch it with changes which were already made with my team in 1st git repository.</p>

<p>For such purposes i try to use git patches: </p>

<ul>
<li><code>git-format-patch --zero-commit --stdout &gt; master.patch</code> to create
single file of changes which were already made to <code>master</code> of 1st git
repo  </li>
<li>and <code>git-am</code> to apply commits from <code>*.patch</code> file  on <code>master</code>
of 2nd repository</li>
</ul>

<p>I specify <code>--zero-commit</code>, because hashes in patch file will be wrong, sicne i actually have two different repositories. </p>

<p>The problem is that when i try to apply patch with <code>git am master.patch</code> i get:</p>

<blockquote>
  <p>Applying: %commit_name% error: patch failed:
  readme.md:5 error: readme.md: patch
  does not apply Patch failed at 0001 %commit_name% The copy of the patch
  that failed is found in: .git/rebase-apply/patch When you have
  resolved this problem, run "git am --continue". If you prefer to skip
  this patch, run "git am --skip" instead. To restore the original
  branch and stop patching, run "git am --abort".</p>
</blockquote>

<p>even when i have only one commit in this patch and i want to apply it on the same repo to get the same commit, but on another branch.</p>