Skip to content

Instantly share code, notes, and snippets.

@kolaente
Created January 9, 2019 14:28
Show Gist options
  • Save kolaente/adf8f5fd712b3f99be47787a5141c74e to your computer and use it in GitHub Desktop.
Save kolaente/adf8f5fd712b3f99be47787a5141c74e to your computer and use it in GitHub Desktop.
Create diffs between folders

Compare

Two folders, create a diff file:

diff -r folder1/ folder2/ -iEZbBuN > thediff.diff

The -N treats notexisting files as empty. That way, diff will continue to walk through directories even if a file is not found.

This creates a patch to patch changes from folder1 to folder2.

Filter it to only include php files:

filterdiff -i '*.php' thediff.diff > thediff-filtered.diff

These can then be used with phpstorms "apply patch": right click on diff file -> apply patch

Only show if something changed, not what

diff -r folder1/ folder2/ -iEZbBuNq

-q Option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment