CSC 509 CVS Basics
cd ~ emacs (or vi or pico) .cshrc Go to the end of the file and add the following five lines: # # CVS settings # setenv CVSROOT ~librarian/projects/CVS umask 022 Exit the editor source .cshrc
cd ~ mv projects projects-f99 cd ~509-librarian tar cf - projects | (cd ~; tar xvf -) cd www ln -s ../projects .
cd ~ mkdir work cd work cvs checkout your-project
cd ~/work/your-project/... edit some-file cvs add some-file cvs commit -m "log message" some-file
cd ~/work/your-project cvs update -d
cd ~librarian/projects/work/your-project cvs update -d
To remove a file X that is already in the repository, do the following:
The "-f" option to remove tells cvs to force the removal of the file; this will both remove the file from your working directory and schedule it for removal from the repository. The cvs commit, as with add, will actually commit the removal.cvs remove -f X cvs commit -m "..."
You can get a short form file status list as follows:
The `-n' option means to not actually do the update, but merely to display statuses; the `-q' option avoids printing the name of each directory. When you use cvs update in this way, you will receive a list of files in your work directory that differ from the repository. Each file will be preceded with a one-letter code, described as follows:cd ~/work/your-project cvs -n -q update
Code Meaning -----+--------------------------------------------------------- U | Another team member has checked in a changed version of | the file. Use cvs update without the -n | argument to update your version of the file from the | repository. M | You have modified the file since the last time you | checked it in. Use cvs commit to update the | repository from your file. ? | You have created a new file that is not yet in the | repository. Use cvs add and cvs | update to add your file to the repository. A | You have added a file (via cvs add) but not | yet committed it. Use cvs commit to commit it | to the repository. R | You have removed a file (via cvs remove) but not yet | committed the removal. Use cvs commit to | commit the removal from the repository. C | A conflict exists because someone checked in a file to | the repository that you have modified. This case | should never happen given the CSC 509 convention that | only one person checks in a given file. If it does | happen, contact the person in your group to resolve the | conflict and see Fisher for how to proceed.
You can get a long form file status listing as follows:
This presents basically the same information as cvs -n update, plus more and in a more verbose format.cvs status
Within the directory where the files to be ignored reside, add the names of the files to a .cvsignore file. Note that since .cvsignore is a regular file, it should be added to the repository just like all other files.
Whenever a file is checked in, you must ensure that its permissions are world readable. The umask setting of 022 (from Step 1 above) automatically makes all newly created files world readable, so this will be the normal state of your files.
If a file is checked in without world-read permissions, you can go to the repository and change the permissions there. This is possible since cvs retains file ownership to be that of the user who last checked in the file. To change permissions for a checked-in file named X in projects subdirectory D, do the following:
cd ~librarian/projects/work/your-project/D chmod go+r X