Feedback

Articles → Resolve Subversion Conflicts

This article describes how to resolve Subversion conflicts when using Microsoft Office documents versioning with MagnetSVN.

Index

Many of us use Subversion for Microsoft Office documents versioning. It helps us to keep documents up-to-date and access older versions any time we want.

What is Subversion Conflict

However our attention is required sometimes to manually resolve some issues. Subversion cannot handle concurrent editions of binary files, such as, for example, Microsoft Office documents. Consider the following situation.

1. Alice creates an empty document and adds it to the Collaborative Project;
Alice's changes

2. Bob opens the same document from his Collaborative Project Folder, changes it and executes 'Commit' command;
Bob's changes

3. At the same time Alice changes her copy of the document and executes 'Commit' command on a second later than Bob. 'Document is out of date' window shows up;
Document is out of date message

4. Alice executes 'Update' command and gets conflict. Subversion cannot automatically merge Alice's and Bob's changes.
Document is in conflicting state message

Conflict is a situation when Subversion doesn’t know how to combine concurrent changes (Alice's and Bob's) into resulting document. Subversion cannot merge changes as it does with text files because Microsoft Office documents are binary (speaking more accurately, they are zipped XML files but Subversion cannot merge ZIP or XML automatically).

Resolving Conflict

There are several ways to resolve conflict for Word and Excel documents (MagnetSVN suggests corresponding alternatives as shown above):

  • Use Repository Document to discard your local changes and replace the document with its newest version from the repository.
  • Use Local Document to keep your local changes and discard newest changes of the document in the repository.
  • Cancel to resolve conflict later manually.

If you choose the first alternative the newest version of the document will be retrieved from the repository. Your changes in the local copy of the document will be discarded immediately.
Resolve conflict using repository document scheme

If you choose second alternative the document in repository will be replaced with your local copy. Other's changes of the document will be overwritten by yours after commit.
Resolve conflict using local document scheme

The third alternative can be chosen to merge changes in a Word document from both local copy and repository.
Resolve conflict merging changes

Merging Word Documents Changes

If both local and repository changes are important and need to be merged into resulting document, for Word document we suggest the following procedure:

To combine changes from both repository and local copy do the following steps:

1. Save a temporary copy of your document under different name and close it.
Saving conflicting local document into different file

2. Open original document and Revert local changes in it.
Reverting changes in local document

3. Update original document from repository.Press Begin Edit and Close your document. You will be asked to release it. Press No;
Updating local document

4. Press Begin Editing and then Close your document. You will be asked if you want to release it. Press Close;
Begin Editing document
Keep the document for Editing

5. Merge changes from these two documents (copied and updated) using Word command ReviewCompareCombine.
Combine changes with local and repository changes
Combine documents dialog

6. Review every single change
Review document changes

... or accept all changes.
Accept all changes in document

7. Save resulting file on top of original one.
Review document changes

8. Press Commit to put merged file into the repository.
Commit changes in document

For more information about combining changes in Microsoft Word please visit the following website:

We hope you enjoy using Subversion for document versioning with MagnetSVN!

Back to Article Index.