Scrivener Sync Conflicts

I’ve been absent for a couple weeks, thanks to the adventure unfolding beyond the page with my new son Evan. He is doing great and fatherhood is proving a most unexpected delight.

What little writing I have managed in the last few weeks (and I actually have strapped on a couple thousand words) has been *almost* entirely on my iPhone, using the mobile Scrivener app I wrote about a couple months ago. Typing on a phone is far from an ideal experience, but it is working for me, and letting me use free minutes here and there in a more productive way.

Sync Problems

Today I hit my first issue. I don’t know exactly what happened, but I fired up Scrivener on my laptop and was met with a dire warning: the Mobile Sync encountered conflicts! Scrivener then closed out my project, made backups, did who knows what, and popped back up with a new folder down at the bottom called CONFLICTS.

screen-shot-2016-10-12-at-16-54-38

Eeek. I have plenty of experience resolving conflicts with source control frameworks and diff utilities, but what can I do with Scrivener?

It’s okay! Nothing is lost!

So I did some research and eventually figured this out. The first thing to do is take a deep breath and realize that nothing was deleted. When Scrivener is unable to merge changes together, it just saves the two conflicting copies of the file. All your words are there, you just need to figure out which file they live in. In some cases you will need to compare the two versions and manually merge the differences together, if they both contain some new changes and some old changes. It takes a little patience, but rest assured it can be done without losing any valuable words.

Snapshots

This is a cool feature in Scrivener that I’ve not really played with before. Basically, you can save versions of individual files and keep track of the changes as you go, including the ability to roll back to older versions. This is the functionality we’ll use to quickly figure out how to merge our files.

What you want to do is pull up one of the conflicted files, then choose Document->Snapshots->Take Snapshot

This will save a copy of this particular version off to the side for us to compare to later. If it doesn’t open the snapshots sidebar, you can click the camera icon next to the notes area, or choose Document->Snapshots->Show Snapshots.

screen-shot-2016-10-12-at-16-55-18

What you should see on the right is a list of all your snapshots for this file, in particular, the one we just made:

screen-shot-2016-10-12-at-18-19-59

Copy & Paste

Believe it or not, that was the hard part. Now we are going to use a little trick to let us see the specific changes and decide what is the correct version, without missing anything.

My naming convention, as you can see in that first screenshot, is not the clearest. However, from looking at the text I know what chapter each of those files comes from. I just made a snapshot of the first one in that list, which happens to be my chapter 1. Now I scroll up and find the real version of chapter 1 under my Manuscript:

screen-shot-2016-10-12-at-16-56-30

Once there, I do Edit->Select All, then Edit-> Copy

No, go on back to your conflicted version, the one you just took a snapshot of. Once there do, Edit->Select All, Edit->Paste.

This changes the contents of the conflicted file to match the contents of the Manuscript file, but because we have a snapshot saved, we can drill in to see exactly what those differences are. To do this, click the “Compare” button (no need to save a new snapshot).

screen-shot-2016-10-12-at-16-55-33

Now on the left you will see a version of the document with blue writing indicating new text that was not in the snapshot, and red strikethrough indicating text that was in the snapshot, but has now been deleted by the manuscript version. You can use the arrows to jump from difference to difference, and manually copying the right bits back up to the Manuscript version of the file.

screen-shot-2016-10-12-at-18-29-23

So in this case, I can see my “Conflicted” version had an extra line, which has been deleted in the “Manuscript” version (e.g., it is in red). In this case that line was supposed to be deleted, so I don’t have to do anything, my manuscript version is right.

You can go one by one until you have them all resolved. When you are all done, right click on the Conflicts folder and move it to the trash.

*whew.* Crisis averted.

Back To Top