git: Patch does not have a valid e-mail address

tmporaries picture tmporaries · Jun 27, 2013 · Viewed 13.5k times · Source

I have a patch-file.

I want to apply this patch to my code in git repository.

When I used subversion this process was quite simple: right click -> tortoise svn -> apply patch. It always works as I expected.

But I cannot do this using git. Git doesn't apply my patch. It complains about

Patch does not have a valid e-mail address.

So, my question is: "How apply patch file in this situation?"

Answer

GoZoner picture GoZoner · Jun 27, 2013

Git created patches are meant to be applied with Git tools. Use

git apply <patch>

If the patch is not created with Git, then just use a patch program 'behind the back' of Git. Often this is the program 'patch':

patch <patch>

After applying the patch, add and commit in Git as usual.