# Outside edits & versions

How changes from other editors, scripts and Git reach a shared project, when Oleafly asks before sending them, and how to restore a version or a deleted file.

A shared project is an ordinary folder on your computer. Other programs can change its files, and Oleafly brings those changes into the shared project.

## Other editors and scripts

When another editor, a formatter, a script or a command-line tool saves a file in the project folder, Oleafly notices and sends the change to everyone. It works even while others are typing in that file.

Oleafly compares the saved file with the version it last wrote there. Only what the other program changed is applied. Text your co-authors typed in the meantime stays where it is. An editor that saves every second while others type is fine too.

## Large changes ask first

Some operations change many files at once: switching a Git branch, pulling, unpacking an archive over the project or restoring an old version. Oleafly holds back a change like that and asks before it reaches everyone. It asks when 10 or more files change at once, or when at least 3 files change and they make up 30 percent or more of the project's files.

A banner above the editor says how many files changed outside Oleafly, and asks whether to send the changes to everyone or keep them local:

- **Send** sends the changes. They merge with whatever others are typing.
- **Keep local** keeps those files as they are on this computer only. Everyone else keeps the shared version. If you edit one of those files later, only your new edit is sent.

### When the project folder disappears

If the project folder becomes unavailable, for example on a drive you unplugged, Oleafly pauses syncing for that project instead of treating every file as deleted. It says so, and syncing starts again when the folder is back.

## Git in a shared project

Git history isn't shared. Each person can keep their own repository in the project, and commit and push to their own remote. See [Git and source control](/docs/git-history/).

Git changes the files on disk, and those are the files Oleafly shares. Checking out another branch or pulling sends those files to everyone, after the question above when many files change. If you only want to look at another branch, choose **Keep local**, or use a separate clone outside the shared project.

### The diff view is read-only

In a shared project, diffs in Source Control are read-only. The diff says "This diff is read-only in a shared project. Edit the file in the editor." Make your change in the editor, where it merges with everyone else's typing.

## Version history

Each person keeps their own history of a shared project:

- [Saved checkpoints](/docs/checkpoints/) are taken on your computer after successful compiles, as in any project.
- [Git commits](/docs/git-history/) are the ones you make in your own repository.
- **Review** in **Activity** shows what others changed while you were away. Read [When you reconnect](/docs/collaboration/offline/#when-you-reconnect).

## Restore a version

Restoring works as it does in any project. Open **Versioning → Saved Checkpoints**, or **Versioning → Git History**, and choose **Restore** on the version you want. Owners and editors can restore.

In a shared project, restoring changes the shared files for everyone. Oleafly sends the restored text as an edit, so whatever others are typing at that moment merges with it and isn't lost. If the restore changes many files, you get the **Send** or **Keep local** question first.

Because everyone gets the result, tell your co-authors before you restore.

## Restore a deleted file

Deleted files wait in **Recently deleted** in the **Live collaboration** pane. Select **Restore** to bring one back for everyone. Read [Recently deleted](/docs/collaboration/files/#recently-deleted).
