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