Patching with Git Creating a Patch Patch for Working Copy (Not Committed) git diff > patch.diff Patch from one commit to another git diff > patch.diff Patching a Project Generated from git diff Applying a Patch: git apply patch.diff Solution for Whitespace Errors git apply --ignore-space-change --ignore-whitespace patch.diff Make sure that you removed whitespaces from both patch file and from the files you are going to patch. References: Whitespace errors Applying git patch