Synchronize
Compare a site with its Remote server, see every file that differs, choose, and only then move anything.
The dialog
Synchronize... asks the questions of Dreamweaver's Synchronize dialog, each answer preselected from the last time:
- What to synchronize: the entire site, or the files chosen in the Explorer. This question appears only when it started from an Explorer selection.
- Which way: Put newer files to remote, Get newer files from remote, or Get and put newer files.
- Files only on the other side: keep them, or delete them, worded for the direction, such as Delete remote files not on local drive.
The extension then compares both sides, with progress and a Cancel button. Unchanged files are counted, never listed; if nothing differs, a message says the site is in sync.
The Sync Preview
The preview groups the files by what will happen to each, with a count on every group, decisions first:
| Group | Holds |
|---|---|
| Resolve | Files changed on both sides, or differing with no sync record. They have no checkbox until you choose. |
| Put, Get | Files that move to or from the server, checked. |
| Delete remote, Delete local | Files the delete option removes. Files never synchronized before start unchecked. |
| Guarded | Sensitive files such as .env, unchecked until you check them. |
| Skip | Files you chose to skip or mark as synchronized. |
| Errors | Names that cannot be used on this system, case twins and links, which never move. |
The view's heading names the site, the server and the direction; its description gives the summary, such as Files: 36 will be updated, 169 will be skipped, 2 need a decision. The setting syncServers.preview.groupBy groups by folder instead.
Choosing for a file
A file under Resolve offers, inline and in its context menu:
- Use Local: put the local copy.
- Use Remote: get the server's copy.
- Skip: leave both copies this time.
- Compare with Remote: see both copies side by side.
- Mark Synchronized: record both copies as in step without moving either.
Choosing moves the row to that group, checked. Any row can take the actions its copies allow, including Delete on Server and Delete Local File. Several rows can be chosen at once, and while a preview waits every action is also in the Command Palette, acting on the rows chosen in the view.
Running it
Synchronize Checked Files in the preview's title bar runs the checked rows. Check All, Uncheck All and Close Preview sit beside it.
- With
syncServers.confirmDeleteson, deletes are listed and confirmed first. - Deleting more than the site's delete limit, 50 files or 25 % of a side by default, needs the count typed back.
- Mirroring from an empty folder is refused, as are deletes at the top of a server unless the server allows them.
- Each file is checked again just before it moves; one that changed since the preview is skipped and reported.
- Progress shows in a notification and in the status bar, such as
My Site: 12 of 37 files, and Cancel stops between files.
A notification reports the result, such as Synchronized 36 files. 1 failed. 169 skipped. A clean run closes the preview; a run with failures keeps them in the view with their reasons, and the status bar warns until you close it.
Compare with Remote
Compare with Remote fetches the server's copy into a read-only editor beside the local file, in VS Code's diff editor. For a binary or very large file it shows both copies' sizes, times and SHA-256 hashes, and says whether they match. The server's copy is held in memory only while its editor is open.
Put and Get
Put and Get move the file open in the editor, the files chosen in the Explorer or the Remote Files view, or, from the Sites view, a whole site after a question. They go through the same plan and guards as Synchronize: a file that needs a decision, a held-back file or a delete opens the Sync Preview instead of moving, and Put asks to save open files with unsaved changes first.