Sometimes I would like to recursively compare the files in two directories to see if one is missing in the other. Sometimes I would even like to discover files which contents are different in two directories.
So let’s see how Emacs can support me to do the job.
M-x ediff-directories and inserting the two directories in question (or 3 directories by using ediff-directories3) and an optionally regexp to only match certain files Emacs will open a new buffer that lists the top of both directories.
To recursively compare them and get the differences just press
== followed by a
D. This will show you all different files. Subdirectories with differences contents dont have the prefix
= and can be displayed by pressing enter.
You could also mark different files and directories and get a patch file by executing
Another but not builtin diff tool with a nicer UI is Ztree.
After the installation run it with
M-x ztree-diff. This opens a new buffer, where you can hide/show all equal files and directories by pressing
h and to copy or delete differences with
D. No need to enter subdirectories thus it will give you a tree view per default.