git:patches - evanmoran/quick GitHub Wiki

In git you can create patches and apply them. Here is how:

Create a patch from a commit

git format-patch HEAD^ --stdout > output.patch

Create a patch from a stash

git stash show -p [stash@{3}] > output.patch     # The stash reference is optional

Apply a patch from file

git apply output.patch