How to generate patches with git format-patch

From OpenHatch wiki
Revision as of 00:35, 21 February 2011 by imported>Jesstess (Created page with 'git-format-patch prepares e-mail ready version of patches. In its basic invocations, it will create a .patch file per commit, of the form 000X.First_line_of_commit_message.patch,…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

git-format-patch prepares e-mail ready version of patches. In its basic invocations, it will create a .patch file per commit, of the form 000X.First_line_of_commit_message.patch, where X is the number of the commit in the commit series.

Here's an example of using git-format-patch with OpenHatch:

1. Add a commit on your development branch

oh-mainline$ git branch
* jesstess
  master
oh-mainline$ touch new_file
oh-mainline$ git add new_file
oh-mainline$ git commit -m "Test commit"

1. Generate a patch using git-format-patch

oh-mainline$ git format-patch master
0001-Test_commit.patch

http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html has the full documentation on git-format-patch.