Command line diff / patch tool for https://github.com/google/diff-match-patch
file-patch can compare and modify any text base files in any operating system.
If you have modified some part of your dependent modules or libraries (modified certain block in apache config, change color for blog theme...)
file-patch can reduce your effort to maintain and upgrade these files.
You can install it via npm
npm install file-patch
After install the package provides
file-patch commands. They can be used to compare and modify any text base files.
You can find some examples in the source repo. Each example contain 3 files:
- the origin file
- the modified file (with
- the diff file (with
You can run
npm run examples-diff command to genereate
.diff file via
file-diff. Or run
npm run examples-patch command to make the origin file exactly the same as the modified file.
file-diff can compare 2 files and generate the
$ file-diff file1 file2
file-patch can apply the diff file to the target file.
$ file-patch file1.diff file
patch file (file1.diff) to