# Using your own CVS directory

CVS is a version control system for source code. We don't care whether or not you actually use it to control your site-local modifications. However, even if you don't, it's still important you put your modifications under a directory in ``$LJHOME`/cvs`.

At this point, you already have a directory named `cvs` underneath your `$LJHOME` directory. Further, that directory already has under it a directory called `livejournal`, which holds the general files.

What you want to do now is make a directory that holds the local files. The LiveJournal tools look for your files in a directory beside `livejournal` named `local`, but `local` can actually be a symlink to your real directory. LiveJournal.com uses the directory name `ljcom` for its site-local modifications, so the `livejournal` directory is entirely free of LiveJournal.com-specific code. If you're helping with LiveJournal.com development, you'll want to symlink ljcom to local.

## cvsreport.pl: Adding & Overlaying

In ``$LJHOME`/bin` there's a tool named cvsreport.pl which manages (among other things) merging together the general files and your site-local files into the live area under `$LJHOME`.

The command you'll need most of the time is:

    $ cvsreport.pl -c -s

`-c` is short for `--cvsonly` (only copies from the `cvs` directory back to the live area, not vice-versa) and `-s` is short for `--sync` (which means actually do the copying, don't just print out what it would've done, which is the default without `-s`).

So, say you want to override the provided `htdocs/index.bml` file. Create the `htdocs` under `$LJHOME/cvs/local` and put a `index.bml` file in it, then run cvsreport.pl `-c -s` and you're set.

More commonly, you'll be adding new files, rather than replacing provided ones. In general, you should never really need to replace files, since you should already be able to change all the text, images, and layout of any given page. Replacing a file would mean duplicating functionality, and that's bad.

One popular strategy with the general code libraries is to look for a similarly named file with `-local` in it and load that also. That way you inherit all the functionality that's provided, and change only what you want. When general changes, you don't have to update right away... you can change things later if you want, or keep the newly added stuff as it was given to you.