Git: Creating and Importing Patches

Git allows you to create patch files that may be email or transfered in other ways the imported into a repository from outside the git chain.

Creating a patch

To create a patch file of the last commit

git format-patch -1 
gzip 0001-name_of_patch_file.patch
Patching a file or directory
gzip -dc 0001-name_of_patch_file.patch.gz |git apply