git : empty ident name (for <>) not allowed

前端 未结 4 2029
没有蜡笔的小新
没有蜡笔的小新 2021-02-02 08:07

I was applying a diff file of an opensource project on the top of my repository using git-am :

 git am -3 < /Downloads/refactorWork.diff

but

4条回答
  •  隐瞒了意图╮
    2021-02-02 08:33

    This diff file is a plain diff, not something generated by git format-patch. A format-patch generated diff contains information about the commit author, author date, commit message, ... and maintains this information when creating the commit(s).

    Your plain diff does not have these information, so git am will complain that it is missing naturally.

    You should instead have used git apply which is meant to apply simple patch files like you have in this case which will only apply the patch to the worktree (and index if you tell it to) but does not create any commit automatically.

提交回复
热议问题