Synck basics

This chapter covers the commands you will use day to day in a repository’s checkout: a folder of ordinary files that Synck tracks. After reading it you will be able to record changes deliberately, reorganize files without losing their history, find out what happened and when, undo mistakes, and mark the versions that matter.

If you have not yet done the first-repository tutorial, do that first. This chapter builds on it.

The life of a file

Every file in a checkout is in one of a few states, and synck status tells you which. There is no staging area, so there are fewer states than in Git:

 you create a file      ──▶  A  added       ── commit ──▶  unchanged
 you edit it            ──▶  M  modified    ── commit ──▶  unchanged
 you move or rename it  ──▶  MV / RN        ── commit ──▶  unchanged
 you delete it          ──▶  D  deleted     ── commit ──▶  in the trash ── recover ──▶  unchanged
  • A file you create is added (A) until you commit it.
  • A tracked file you change is modified (M).
  • A tracked file you remove is deleted (D). Committing a deletion puts the item in the repository’s trash, from which it can be recovered with its identity and history intact.
  • Moves and renames are their own kinds of change (MV, RN). They keep the file’s identity. See Moving, renaming and deleting.
  • Files that match .synckignore, and hidden files by default, are ignored and never appear in status.

synck commit takes everything that is not unchanged and records it as one commit, unless you name specific paths.

What this chapter covers

Page Commands
Recording changes status, diff, commit, .synckignore, config
Moving, renaming and deleting mv, deleted, recover
Viewing history log, show, history, versions, diff, compare
Undoing things restore, restore-tree, revert, recover, export
Named versions version create, list, promote, restore and more
Email and chats committing .eml and .msg files, item, repository create-chat, append-chat
Committing large folders commit --batch

Everything here applies to any repository with a checkout: one you created with synck init, or a copy you checked out yourself. A checkout can also be sparse, holding only some folders; then these commands work on the folders it holds.