Git Patch

Git patches are text files that contain code and Git commit metadata.

Git patches are text files that contain code and Git commit metadata.

Generate a Git Patch For a Specific Commit

Generate a patch for the HEAD commit:

1git format-patch -1 HEAD

Generate a patch for the HEAD commit with specified file name:

1git format-patch -1 HEAD --output=head.patch

Generate a patch for HEAD - n commits:

1git format-patch -<n> HEAD

Apply the patch with verbose:

1git apply --verbose *.patch

アリメクタ’s Blog

Watch. Read. Run. Repeat.

World’s Best Company Ask Me First

The first rule of Fight Club is: "You do not talk about Fight Club."

The second rule of Fight Club is: "You do not talk about Fight Club!"