Source control basics

When you collaborate with other people on documents that are under source control, the workflow is different from when you work alone with documents that belong exclusively to you. The basic ideas in source control are as follows:

  • There is a set of “master” documents and resource files, somewhere in a database or folder that all the collaborators have (secure) access to. These master files are considered the definitive versions of the documents—they may even be the actual published documents on the Web server.
  • When an author needs to edit a document, he or she does not edit the master copy. Instead, the author checks the document out—that is, he or she copies the master document to the local computer and, at the same time, locks the master copy so that it cannot be replaced by another author. Then, the author edits the local copy. When the author is finished editing, he or she checks the document back in to the source control database, replacing the master copy with the edited local copy and, at the same time, removing the lock on the master copy.

This process ensures that, at any given time, only one author can update a master document, thus avoiding the situation where two or more authors save “overlapping” versions of the same document to the central repository and lose their changes.

Preparing to use source control

The following tasks must be performed before your team can start editing source-controlled documents:

  1. If the documents to be edited collaboratively are not already part of a local siteA managed collection of documents, folders, and resource files on the local file system that you intend to publish as a Web site., create a local site on a client computer and then add the desired documents to it.
  2. Connect to the source control server and add every file in the local site to the source control project or folder.
  3. Every other author on the team must now obtain a copy of the site files, so that he or she can open the local site on his or her own computer. However, at this point, the other authors will not be able to use Namo WebEditor to retrieve the site files, because the command is not available until the local site is open. To get around this paradox, the other authors must obtain the files another way. Here are some alternatives:
    • Use a standalone source control client program on each client computer to download the files from the source control server. (For SourceSafe, use Visual SourceSafe Explorer. For WebDAV, several open source and commercial clients may be found on the WebDAV Projects web page.)
    • If the source control server is also a file server on the local area network, simply copy the site files from the server to each client computer using Windows.
    • On the client computer that was used to create the local site, use the Site Manager’s Export Site command to save the site files in a zip archive. Distribute the zip archive to each team member (through email or any other method). On each client computer, use the Site Manager’s Import Site command to unpack the site to a local folder.
Overview of source-controlled workflow

The following outlines the tasks involved whenever you need to edit a source-controlled document:

  1. Connect to the source control server, if you are not already connected.
  2. Check out the documents to be edited.
  3. Edit the documents.
  4. Check the documents back into the source control server.

Source control basics