|
|
C.2. Using CVSC.2.1. Setting Up Your CVS AccountFirst you'll need to get an account at the LDP's CVS Repository. Please see the notes above on obtaining an account. This repository houses various documents including HOWTOs and Guides. Documents are sorted by the type of document (for example a HOWTO or a Guide), and by the markup language the document uses (for example DocBook or LinuxDoc). When your account is ready you can log in using one of the following commands. In all instances your_userid should be replaced by the user name you were issued in the response email. You will be prompted for a password after this first step. Initializing Your CVS Account
Wait patiently while the system tries to log you in. It can often take more that 10-20 seconds for the system to either accept (or reject) your password. Once you've used cvs login for the first time and have been given access to the system, your password is stored in .cvspass and you will not have to use cvs login again. Just set the CVSROOT with the export command listed above and continue on. If TLDP's CVS server is the only one you work with, you might also add an export CVSROOT line to your ~/.bashrc shell configuration file. C.2.2. Getting the DocumentsYou can get the entire repository with: cvs checkout LDP Or you can get the source for your own document with: cvs checkout LDP/howto/docbook/YOUR-HOWTO.xml OR cvs checkout LDP/guide/docbook/YOURGUIDE Windows users will need to use a modified version of this command. Instead they should use: cvs -d %CVSROOT% checkout LDP/howto/docbook/YOUR-HOWTO.xml
C.2.3. CVS CommandsCVS Commands: a brief reminder
If you need to change a file name, you still need to use the add command. First remove the copy of the file from your local disk. Then remove it from the CVS tree with: cvs remove filename. As with the add command, you need to >commit your removed file. Finally, now that the old file has been removed, add your new file using the instructions above (first add and then commit the additional file). C.2.3.1. Recovering old versionsThere you are, typing away, when you screw up. Real bad. Doesn't matter what it is, but suffice it to say that you've toasted not only the version on your local drive, but created a new version on the CVS server. What you need to do is go back in time and resurrect an older version of your file. To do this, you'll need to know the version number of the file you want to retrieve. cvs diff will give a list of revisions if there are differences. You can pick the revision number, subtract one, and that is probably the revision you want to look at. The command cvs -Q update -p -r revision filename will output to stdout the contents of the revision version of filename. You can pipe it to more or redirect the output to a file. Conveniently, you can redirect stdout to a file called filename. Your local file is now the revision you want, and cvs update will update the CVS server with the new (old) version of filename. |
