*banner
 

Software Development
FAQ
CVS
Previous section  |  This section  |  Next section
Previous question  |  This question  |  Next question

Common CVS Commands
Christopher Brooks, 10 Aug 2012
Last updated: 10 Aug 2012

Below is some text from William Wu about CVS commands
cvs import [module|file]
add files/modules into the repository directory.
cvs commit [module|file]
Check in your modified files/module to the repository, creates a new file that merge your file and the one in repository. Note it is a MERGE not a replace, so it could cause problem. A good rule is to after you modified the file, do a cvs update (see below) first, so you have the newest version, and try to recompile and run, so that you can find any conflict that arise.
cvs update [module|file]
updates your files to the files in the repository, if you have made some change to your files, it will merge the two. This is always a good thing to do before you do commit, since someone else can modify the file and check in after you last update, thus it is possible the changes he made is in conflict with you changes. By doing a update, you can find out about the changes he made and spot any conflict. (conflict is indicated by a letter c in front of file name, in the messages from CVS)
You can run cvs -n update to preview what would happen if you ran cvs update. The -n option does not change any files, it only issues reports.
Note that usually you will want to use cvs update -P -d, which Prunes empty directories and creates new directories. You can set this as the default by creating a ~/.cvsrc file that contains the line
update -P -d
If you run cvs update without the -d flag, then you might not get any new directories created
cvs checkout [module|file]
Use this when you check out the files/module for the first time. When someone had import a new file in, you can use this command to check it out, or I think do a update on the module will also add the new file to you directory.
cvs add file
Add a file or directory to the repository.
For binary files like PDFs or image files, use cvs add -kb file. The -kb prevents keyword substitution when a binary file is checked out. To fix a file that was checked in without -kb, see Admin commands.
cvs status [module|file]
Give a status report on the files comparing with the newest version in the repository. The files status can be Up-to-Date, Modified ... Uses this command before commit, then you can check if you need to do a update or not.
cvs diff [module|file]
does a diff with your file and its newest version in repository.
cvs history [module|file]
gives a report on the history of modication done on this file, users, date etc.

These are some commonly used ones, you can always use cvs(1) man page for help.

Previous section  |  This section  |  Next section
Previous question  |  This question  |  Next question
©2002-2018 Chess