To compare a project folder on your Mac with a copy on an SSH-accessible server, use rsync in dry-run mode. It can list which files appear out of sync without transferring or changing them. For text differences inside one file, use diff after bringing both versions onto the Mac. This guide focuses on comparing a local project directory with a remote directory; it does not assume the two copies are synchronized or tell you which version should win.

Check the connection and paths first

Open Terminal on your Mac. Apple documents SSH as one of the protocols Terminal can use to connect to remote servers; with the command-line ssh client, you can also run a command on the remote machine. You’ll need a server name, a remote account, access to the project directory, and working SSH authentication. Apple’s Terminal guide and the OpenBSD ssh manual describe these connection options.

Replace the example account, host and folder names below with your own. The remote machine must have rsync installed and available to your account. rsync --version shows the local version; a remote version can be checked with ssh user@host rsync --version.

ssh user@server.example.com

If that login fails, resolve the host, authentication, network or access issue before comparing files. Then identify both project directories precisely. In the examples, /Users/you/Projects/site is local and /srv/projects/site is remote. Keep the trailing slash on each directory path to compare the directory contents in the same relative layout. Quote paths that contain spaces.

Preview which files differ

Run this command from your Mac:

rsync -rnic --out-format='%i %n' \
  user@server.example.com:/srv/projects/site/ \
  /Users/you/Projects/site/

The remote path is the source and the Mac path is the destination. The command uses recursion (-r), itemized change output (-i), checksum comparison (-c) and dry-run mode (-n). Rsync’s documentation says dry runs make no changes; itemized output gives a concise list of proposed updates. In this direction, a listed item means the remote source differs from, or is missing in, the local destination. The rsync manual documents dry runs, itemized changes and checksum comparison.

Checksum mode reads file data on both sides to compare content, so it can take longer and use more disk I/O than rsync’s default quick check, which relies on file size and modification time. Use -nic when contents matter even if timestamps or sizes might not reveal a change. For a faster preliminary pass, use -rin instead; that reports changes detected by rsync’s quick check and can miss content changes when both size and modification time match. The preview does not display changed lines inside files.

Reverse the two paths if the Mac copy should be treated as the source and the remote copy as the destination. The direction matters: rsync’s itemized markers reflect what it would update at the destination. Keep -n while inspecting results. Remove it only if you deliberately decide to perform a transfer; rsync is a copying tool, not a two-way merge.

Read the contents of a text-file difference

To inspect actual line changes, compare two local files with diff -u. First copy one version to a separate temporary location using your normal approved transfer method, or use a project copy you already have locally. Then run:

diff -u \
  "/Users/you/Projects/site/config/settings.yml" \
  "/Users/you/Desktop/settings-remote.yml"

Unified output places nearby context around changed lines. Lines prefixed with - are from the first file; lines prefixed with + are from the second. diff is a content comparison, so it won’t transfer or merge edits. For a whole local directory tree, diff -ru local-folder remote-folder compares corresponding files recursively, but the remote folder must be mounted or otherwise available as a local path. The GNU Diffutils manual explains recursive directory comparison and unified output; macOS command options can vary, so check man diff on your Mac if an option is rejected. GNU Diffutils manual.

Understand the limits before acting

A clean rsync preview means no differences were detected using the comparison rules and paths you selected. It does not show a side-by-side review, resolve conflicting edits, or guarantee every filesystem property is equivalent. Rsync’s checksum option compares file contents, while metadata such as permissions and timestamps depends on which options you select. Also, the file trees may change after the preview if someone edits either copy.

If the remote system does not provide SSH or rsync access, this workflow will not work as written. Use an access method permitted by that system, make two accessible local copies, and compare them with diff or another suitable comparison tool. Do not run a transfer command in place of the preview unless you intend its source-to-destination update behavior.

Sources