Patch

Patch

git man page

Creation

search summary copied

To create a Git patch, use git diff to generate the changes and redirect the output to a file. For instance, git diff > my_patch.patch creates a patch file named my_patch.patch containing the differences between the current working directory and the last commit. You can also create patches from specific commits using git format-patch or between two branches using git diff branch1..branch2

git diff > some-changes.patch
# OR
git diff > patch.diff

Applying

git apply /Users/patch.diff

SO | post