Git diff and Patch file

A patch file contains a set of changes (i.e., a commit) that can be applied to any branch, in any order. You can convert git commits and differences into patch files. Those can be used to apply to a different repository or by someone else (e.g. sent via e-mail).

git diff > changes.patch
">" this sign writes STDOUT to a file
This basically creates a new file named "changes.patch" in your application root folder.

To apply a patch file you need to use
git apply changes.patch


Post a Comment

Popular posts from this blog

Inserting and Moving elements inside Ruby Array

Difference between Validations, Callbacks and Observers