2016-11-29 68 views
1

最近我从SVN迁移到git,我的团队已经开始在新鲜的git仓库中工作。如何将Git补丁应用于已更改历史记录的存储库?

后来我发现了转换的一些问题,并从SVN做了第二个git repo,并进行了一些修复和历史重写。

现在我有第二个SVN回购(我很满意)的git副本,我想修补它与我的团队在第一个git存储库中所做的更改。

对于这样的目的,我尝试使用git补丁:

  • git-format-patch --zero-commit --stdout > master.patch创建其已经以1混帐的master 回购
  • git-am作出从*.patch文件应用提交更改的 单个文件在master 第二个存储库

我指定--zero-commit,因为补丁文件中的哈希将是错误的,我实际上有两个不同的储存库。

的问题是,当我尝试用git am master.patch应用补丁,我得到:

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

即使我只有一个在这个补丁提交,我想它适用于同一回购来获得相同承诺,但在另一个分支。

回答

0

貌似增加--ignore-whitespacegit am解决的主要问题,但我仍然有一个像warnigs:

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

warning: squelched 9 whitespace

errors warning: 14 lines add whitespace errors.

相关问题