git format-patch
all
Prepare `.patch` files. Useful when emailing commits elsewhere. See also: `git am`.
More info →Examples (3)
Create an auto-named `.patch` file for all the unpushed commits
git format-patch originWrite a `.patch` file for all the commits between 2 revisions to `stdout`
git format-patch revision_1..revision_2Write a `.patch` file for the `n` latest commits
made by @shridhargupta | data from tldr-pages