With git
the diff output requires removing up to the first /
in the path. This should work:
patch -p1 < a.diff
Also try using git format-patch
and git am
(preserves logs if applying patch in another git directory):
rm -rf *.patch
git format-patch -1
git am *.patch
rm -rf *.patch