3

Recently i migradted from SVN to git and my team already started to work in fresh git repository.

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

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.

For such purposes i try to use git patches:

  • git-format-patch --zero-commit --stdout > master.patch to create single file of changes which were already made to master of 1st git repo
  • and git-am to apply commits from *.patch file on master of 2nd repository

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

The problem is that when i try to apply patch with git am master.patch i get:

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".

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.

Kirill
  • 6,762
  • 4
  • 51
  • 81

1 Answers1

0

Looks like adding --ignore-whitespace to git am solved the main problem, but i still has warnigs like:

.git/rebase-apply/patch:56: trailing

warning: squelched 9 whitespace

errors warning: 14 lines add whitespace errors.

Community
  • 1
  • 1
Kirill
  • 6,762
  • 4
  • 51
  • 81