diff folders
November 29, 2020
When stupidly changing sources on a remote system and on the local system, so you cannot easily copy using rsync
for example, I do the following manual steps to get things in order again.
Mount the remote source folder (/home/username/blog.git
) locally over ssh
using sshfs
to the local system (/mnt/blog
):
$ sshfs username@remote_host:/home/username/blog.git /mnt/blog
Then I comapre the remote folder (available locally in /mnt/blog
) to the local version in ~/blog
.
$ diff -rq -x venv -x __pycache__ /mnt/blog/ ~/blog/
diff
considers every folder recursively (-r
) and gives a brief output (-q
).diff
will ingore two folders:
venv
__pycache__
To compare the actual changes and adapt the files I use vimdiff
. Imagine a change in ~/blog/app.py
:
$ vimdiff /mnt/blog/app.py ~/blog/app.py