Omar Omar - 1 year ago 127
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download