Omar Omar - 2 months ago 5x
Git Question

Git apply a patch to the working directory

I have a patch that contains a lot of changes that I would like to split into multiple commits and potentially modify some of the changes.

I want to apply this patch to my working directory and then manually commit the changes. Is it possible to apply a patch to the working directory in git?


You can use git apply which applies a patch:

git apply < patchname.patch

This does not create any commits. In fact, without any options the git apply command doesn't even need to have a Git repository. It just applies patches to files.