代码之家  ›  专栏  ›  技术社区  ›  Aaron Franke

git am:修补程序格式检测失败

  •  18
  • Aaron Franke  · 技术社区  · 7 年前

    我以前从未在Git上使用过补丁,我需要一些帮助。我正在尝试对Git回购应用补丁来测试葡萄酒补丁,特别是 this patch here 。因此,我做了以下工作:

    $ git clone git://source.winehq.org/git/wine.git
    $ cd wine
    $ nano patch.p1
    

    然后,我用 Ctrl键 + 转移 + O

    $ git am patch.p1
    Patch format detection failed.
    

    2 回复  |  直到 7 年前
        1
  •  34
  •   user276648 Jeremy Cook    6 年前

    Patch format detection failed. 可能意味着您使用了错误的命令:use git apply 而不是 git am 或者反过来。

    看见 What is the difference between git am and git apply? 有关2之间差异的更多信息。

        2
  •  4
  •   Amit Kushwaha    6 年前

    使用以下命令: 补丁-p1<patch\u file\u名称。色斑

    • 您将被要求指定“要修补的文件”,并提及完整路径/
    • 假设-R[n]:n
    • 是否仍要应用?[n] :y

    对修补程序中存在的所有文件执行此操作。

    • 如果发生任何合并冲突,请检查“.rej”文件中的冲突,该文件具有 已生成并解决(&S);应用这些更改。
    • 执行“git添加”和“提交”更改。