Create & apply patches
https://stackoverflow.com/questions/2249852/how-to-apply-a-patch-generated-with-git-format-patch
First the stats:
git apply --stat a_file.patch
Then a dry run to detect errors:
git apply --check a_file.patch
Finally, you can use git am to apply your patch as a commit. This also allows you to sign off an applied patch.
This can be useful for later reference.
git am --keep-cr --signoff < a_file.patch