This works with mbox files downloaded from pipermail used by many open source projects. This probably doesn't work in the OP's case, but the same symptom/question results when using git am
with pipermail extracted messages/patches.
Make a backup of the file and edit it to add a line,
From: [email protected] (Proper Name)
Often the line already exists, but anti-spam features may have converted the @
sign to the text at. You can patch a bunch of files with a gnu sed
command like,
sed -ie 's/\(From:.*\) at /\1@/' *.patch
This just replaces ' at ' with the @
sign. After this, git am
should accept it.
If you have access to the git repository you can use the regular commands,
git checkout oldbranch
git format-patch HEAD~4
This will make four files that are patches of the last changes (change the number for your case).
git checkout master
git am *.patch
You get the same commit ids, messages, etc as the remote repository which can be useful later.
Tools like gitk and kdiff do NOT generate the same data as format-patch and you don't get the commit history. If you have this type of data, you must use git apply
or generate patches as above.
See: Difference between git format-patch and git diff.