How to sync one text file across devices
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
- One file, one source of truth. Do not create a “phone copy” and a “work copy”: they will diverge sooner or later.
- One writer at a time. Do not edit the file on two devices simultaneously. Sync first, then edit.
- Version history. Enable cloud versions or use Git. It is cheaper than recovering lost text.
- Backups. Sync is not a backup. Keep a separate copy that one mistake cannot delete.
Sync options
| Service | Platforms | Version history | Notes |
|---|---|---|---|
| iCloud Drive | macOS, iOS, Windows (limited) | Depends on the app | Native on Apple; awkward on Android and Linux |
| Dropbox | All major platforms | 30 days and longer on paid plans | Predictable conflict copies |
| Google Drive | All major platforms | 30 days | Works well on Android and in the browser |
| OneDrive | All major platforms | Yes | Convenient on Windows and Microsoft 365 |
| Syncthing | macOS, Windows, Linux, Android | No built-in history; use backups | Peer-to-peer without a cloud; iOS only through third-party clients |
| Git | All major platforms | Full commit history | Requires commands or a Git client; conflicts are manual |
On a computer
- Install the cloud client or Syncthing.
- Put
everything.txtin the synced folder. - Install the client on a second device and wait for the initial download.
- Test both directions: add a line on one device and confirm it appears on the other.
- 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
- Conflict copy. Dropbox, Google Drive, and OneDrive may create a “conflicted copy”. Compare versions with
diffand move the needed lines manually. - Git conflict.
git pull --rebasemarks conflicting sections. Edit the file, then rungit add everything.txtandgit rebase --continue. - Version history. In the cloud, open the version before the conflict and download it. In Git, use
git log,git diff, andgit checkout. - One writer. The most reliable way to avoid conflicts is not to edit the file on multiple devices at once.
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:
- archive entries by year:
everything-2025.txt,everything-2026.txt; - search with
rgorgrep, not only through the editor; - disable syntax highlighting and the minimap for large files;
- keep attachments out of the file — link to an
attachments/folder.
Checklist
- The file lives in a synced folder.
- The client is installed on at least two devices.
- Two-way sync has been tested.
- Version history or a daily archive is enabled.
- A separate backup exists outside the sync folder.
- Two-factor authentication is enabled with the provider.
- The one-writer rule is followed.
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.