Source Control Defined
October 9, 2000
Source control essentially makes sure that a file's source doesn't
get changed improperly. This includes making sure everyone is using
the latest version of the file, and that no two people are editing
it at the same time, resulting in overwritten changes. You must also
ensure that the files aren't deleted, moved, or otherwise manipulated
in a way that would leave editors scratching their heads.
Typical source control methods use a system of checking files in
and out, somewhat akin to a library system. If a file is checked
out, then no one else should be able to use or edit that file, until
it is checked back in. Similarly, if no one has the file checked out,
then no one should be able to edit it. Note, however, that anyone
may still view the file at any time. This process ensures
that no two people will ever edit the file at the same time. Also,
by making sure that everyone checks files out properly through
the application, no one's changes will ever be overwritten -
unless it was on purpose.
In a web application setting, you would normally store all files
on a central server (though, for our purposes, it really doesn't
matter where the files are). Each user would then download the file
to his or her local computer, edit it, and upload it back to the server.
There may also be a person working directly on the server as well.
When the user downloads the file, they must check it out as well,
and the reverse also applies when they upload the file.
To ensure that the file isn't overwritten accidentally, the file's
attributes should be set to read-only. In fact, the file's attributes
should always be set to read-only, and only changed when absolutely
necessary, for example, when changes must be applied. This is a
good habit to form, though it is too often a pain to manually change
the file's attributes everytime you wish to edit it.
Effective Source Control
Effective Source Control
The Database
|