git diff-tree <commit> -p --pretty > <filename>You can also use git format-patch, but that is more specialized for patches to be submitted by email.
Apply the commit from the file:
git apply <filename>Here is an excerpt from the git diff-tree manual page:
When "git-diff-index", "git-diff-tree", or "git-diff-files"
are run with a -p option, "git diff" without the --raw option,
or "git log" with the "-p" option, they do not produce the output
described above; instead they produce a patch file. You can
customize the creation of such patches via the GIT_EXTERNAL_DIFF
and the GIT_DIFF_OPTS environment variables
No comments:
Post a Comment