Guides

How to sync one text file across devices

Updated:

A single text file is easy to keep on every device — from a laptop to a phone. The problem is solved by a sync layer: the file stays plain text, while a cloud service, a peer-to-peer tool, or Git handles delivery.

Four principles

  1. One file, one source of truth. Do not create a “phone copy” and a “work copy”: they will diverge sooner or later.
  2. One writer at a time. Do not edit the file on two devices simultaneously. Sync first, then edit.
  3. Version history. Enable cloud versions or use Git. It is cheaper than recovering lost text.
  4. Backups. Sync is not a backup. Keep a separate copy that one mistake cannot delete.

Sync options

ServicePlatformsVersion historyNotes
iCloud DrivemacOS, iOS, Windows (limited)Depends on the appNative on Apple; awkward on Android and Linux
DropboxAll major platforms30 days and longer on paid plansPredictable conflict copies
Google DriveAll major platforms30 daysWorks well on Android and in the browser
OneDriveAll major platformsYesConvenient on Windows and Microsoft 365
SyncthingmacOS, Windows, Linux, AndroidNo built-in history; use backupsPeer-to-peer without a cloud; iOS only through third-party clients
GitAll major platformsFull commit historyRequires commands or a Git client; conflicts are manual

On a computer

  1. Install the cloud client or Syncthing.
  2. Put everything.txt in the synced folder.
  3. Install the client on a second device and wait for the initial download.
  4. Test both directions: add a line on one device and confirm it appears on the other.
  5. Enable version history or a daily archive.

Any editor from the editor guide will work. The important rule is not to open the same file on two machines at the same time.

On a phone

On iOS, keep the file in iCloud Drive, Dropbox, or Google Drive and open it in iA Writer, Textastic, Working Copy, or another editor with Files access. On Android, Google Drive, Dropbox, Syncthing-Fork, Markor, and Acode are common choices.

Mobile operating systems may delay background sync. Before editing, open the file and wait for the current version; after editing, let the app finish uploading. If an editor does not support sync, use the share sheet and a copy — and follow the one-writer rule even more strictly.

Git for version history

Git is useful when you need a full history and predictable conflict handling. A private repository on GitHub, GitLab, or your own server works well.

cd ~/notes
git init
git add everything.txt
git commit -m "start OBTF"
git remote add origin git@github.com:USER/notes.git
git push -u origin main

Daily loop:

git pull --rebase
# edit everything.txt
git add everything.txt
git commit -m "notes: $(date +%F)"
git push

Do not store passwords, tokens, or keys in the repository. For sensitive data, use a separate encrypted file or gpg. If the file is large, avoid committing attachments without a reason: the repository grows with its history.

Conflicts and recovery

Security

Sync providers encrypt data in transit and usually at rest, but account access remains a risk. Enable two-factor authentication, use a strong password, and review connected devices.

For highly sensitive notes, use client-side encryption:

gpg -c everything.txt
gpg -d everything.txt.gpg > everything.txt

For a container of files, VeraCrypt works well. Remember: if the decrypted file sits in a synced folder, it is synced in plain text.

When the file gets large

A 5–20 MB file remains workable in most editors. At 50 MB and beyond, several practices help:

Checklist

Once sync is in place, choose an editor: editors for one big .txt.

Start with a ready-made file. The template already has a date, markers, and example entries.

Download starter .txt →