How History Works in bun.ink – States, Milestones and Versions
When bun.ink keeps a state of your work, how to compare and restore earlier states, how to try out an alternative ending in your own version and merge it back in — and what happens when you write on two devices.
In Why bun.ink you'll find the basic idea: bun.ink keeps every draft of your texts without you having to think about it. This post goes into detail. It explains exactly when a state is created, what comparing and bringing back do, how you can use versions to try something out without touching your project, and what bun.ink does when you've carried on writing on two devices.
You'll find everything in History, the clock icon in the sidebar.
A state is the whole project
A state doesn't just capture the document you're currently writing in, but the whole project: every document with its text, its name and its folder. That's why you can later bring back not just a single chapter, but the project as it looked on a particular day.
In History, the states are ordered by day. For each one you can see which documents changed and how many words were added or removed. The newest one is marked Current.
When a state is created
bun.ink doesn't record every keystroke. That would make for a history in which you'd never find anything again. A state is created quietly in the background when three things come together:
- You take a break from writing of two minutes.
- At least ten minutes have passed since the last state.
- Enough has changed: at least 250 characters, or the length of the project has changed by 15 per cent, or you have created, renamed, moved or deleted a document or a folder.
Before the state, bun.ink saves anything still outstanding. A state is created in the project you're currently writing in, and only when there's a connection to the server.
On top of that, some states are created immediately:
- before deleting a document or folder, so nothing is lost,
- before bringing something back, so that bringing back can itself be undone,
- when opening the writing record, so that it includes today,
- when setting a milestone.
Milestones
With Set a milestone you give the current state a name, such as "First draft to the editor" or "Before the big rebuild". If nothing has changed since the last state, that state simply gets the name. Milestones appear in History with a little flag and are kept permanently.
Comparing
Click on a state and you'll see what you can do with it. Compare shows the open document alongside its text in that state, with changes highlighted as in a revision. A second click on Comparing ends the comparison.
While a comparison is open, you can choose Compare with “…” on a second state. Then two states stand side by side instead of one state and your current text — two milestones, for example. What gets compared is always the document that's currently open.
Bringing back
If an earlier draft was better, there are two ways to go:
- Bring back this document sets the open document to its text, name and location in that state.
- Bring back the whole project does the same for every document that existed in that state.
Before bun.ink changes anything, it captures the current state. So you never lose anything when bringing something back, and you can undo it the same way. A few rules apply:
- Documents created after the state stay as they are.
- A document deleted in the meantime comes back.
- A folder deleted in the meantime does not come back. Its documents then end up at the top level of the project.
Versions: trying something out without touching the project
Sometimes you don't want to go back, but sideways: try a different ending, write a chapter from another perspective, attempt a rebuild when you don't yet know whether it will hold. That's what versions are for.
At the top of the explorer you can see what you're currently writing in — at first the Main version: your project as it is. Click on it and the menu opens, with your alternative versions and Try a new version…. You give the version a name and choose what it starts from: the current text, or an earlier state such as a milestone. In the History of the main version you can also do this directly on a state with Start a version from here.
When you're in a version, a narrow band above the editor shows you where you are. You write as normal, create documents, rename them or delete them. The main version stays untouched. The version has its own history with its own states and milestones, and right at the bottom it says which state it branched off from. With Compare with the main version you can see how the open document differs from the main version.
You can switch between the main version and your versions at any time through the same menu. If you don't like a version, Discard version removes it without asking. For ten seconds, Undo brings it back along with its text.
A few things aren't possible in a version yet: creating and changing folders, moving documents and uploading files. For those you switch to the main version. Versions are also not available in high-privacy projects and folders, nor in projects linked to GitHub.
Taking a version into the main version
If the experiment paid off, you bring it into your project with Take into the main version…. To do this, bun.ink compares three texts: the version, the main version, and the state the version once branched off from. That's how it knows who changed what.
- Whatever only the version changed goes into the main version automatically.
- Whatever only the main version has changed in the meantime stays.
- Where both changed the same paragraph differently, you decide: Keep main version, Take version, Both or Write it myself.
A paragraph here is whatever sits between two blank lines. If you rewrote the third paragraph of a chapter in the version and the first one in the main version, there's no question to answer — both come together. You'll also be asked if both sides renamed a document differently, or if one side deleted something the other was still working on.
At the top of the window you can see what will change in the main version. Take over is only available once nothing is left open. Beforehand, bun.ink captures the current state of the main version, and afterwards History shows Version “…” taken over. So even taking a version over can be undone.
Writing on two devices
If you write on your laptop and on your phone, it can happen that both carry on from the same text — because one of them was offline for a while, for instance. bun.ink then brings things together by the same rule as when taking a version over:
- In the main version, bun.ink notices when saving that the document has since been saved on the other device. If the two devices changed different paragraphs, both changes come together and a brief notice tells you so. Only if both changed the same paragraph differently does bun.ink ask, as before (details in Writing Without the Internet).
- In a version, the same happens for the version as a whole. If a passage needs a decision, bun.ink won't interrupt you mid-sentence. A notice offers Review, and you choose paragraph by paragraph: Take other device or Take this device — or both, or you rewrite the passage yourself.
With high-privacy documents, bun.ink always asks when in doubt, because the server can't read their text.
Without the internet
Without a connection, no states are created, because they live on the server. What you write offline stays on the device and enters History with the first state after it's uploaded. That state carries the time at which you were back online. Starting a version, switching between versions and taking a version over all require a connection. For how offline writing works as a whole, see Writing Without the Internet.
How long states are kept
So that History stays manageable over the years, bun.ink thins it out once a week. Of automatic states older than 180 days, the last state of each day is kept. This applies to the main version and to each version separately. Never thinned out are milestones, states that were brought back or taken over, and the states that an open version is built on.
What else History can do
The states of the main version make up the Writing record, which shows on which days and how your text grew (Proving Your Work). And the Copy on this computer writes the main version into a folder on your machine after every state (Why bun.ink).
For anyone who knows Git
If you've worked with Git before, you'll recognise the ideas: a state corresponds to a commit, a milestone to a tagged commit, a version to a branch, taking over to a merge, the project to a repository. The difference: in bun.ink you don't have to do any of it yourself, and there are no commands. How Git and GitHub work, and when linking to GitHub makes sense as well, is explained in Git and GitHub Explained Simply. If you work in a linked project on a branch other than the main branch, GitHub's history applies there, not bun.ink's.