Conflicts
treesync’s first rule is simple: it never loses your data. If the same file is changed in two places before those changes sync, treesync keeps both versions instead of picking a winner.
What causes one
A conflict happens when a file is edited on two devices from the same starting point before they sync — for example, you edit on your laptop and desktop while one is offline, or an agent changes a file at the same time you do elsewhere.
treesync is built mainly for “work on one machine, then switch to another,” so conflicts are uncommon — and when they happen, they’re handled automatically.
What treesync does
When your devices sync, treesync reconciles the changes:
-
Different files changed on each device — both are merged automatically.
-
The same file changed on both — treesync keeps the newest version under the original name and saves the other beside it as a sidecar conflict copy. The name says exactly where it came from:
report.md report (conflict from michal-macbook 2026-06-23 14:05).md
Both files are real, both hold your data, nothing was overwritten. treesync never merges file contents line by line — that’s unsafe for code and impossible for binaries — it just preserves both versions.
Inside a repo’s .git: a conflict copy beside a Git ref isn’t a valid ref
and would corrupt the repo, so there treesync keeps the newest version without a
sidecar. Nothing meaningful is lost — every commit is a content-addressed object
that syncs on its own; at most an old branch pointer is dropped, exactly as a
git push --force-with-lease would. Your working-tree files always get full
sidecar protection.
How to resolve one
The fastest way is resolve, which finds the copies for you:
treesync resolveIn a terminal it walks you through each one with a simple choice — keep your version, use the other device’s, or keep both. No diffs to wade through. Two flags cover the common cases in one shot:
treesync resolve --keep-mine # keep your files, delete the copies
treesync resolve --accept michal-macbook # take the copies from a deviceOr do it by hand — conflict copies are ordinary files. Pick the version you want,
delete the copy, and let it sync (automatic if the daemon is running, otherwise
treesync push). The conflict is then resolved on every device.
Tips
- Not sure yet? Leave the copy in place — nothing is lost and it isn’t going anywhere.
- To avoid conflicts, let a folder finish syncing (
treesync status) before switching machines.