SourceForge.net LogoLinuxFund.org Logo
Home Press Mailing List Documentation Screenshots People SourceForge Downloads

CVS HOWTO

Checking the files out the first time.

If you have only read access to the repository:

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/filmgimp login
 
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/filmgimp co filmgimp

If you have commit access (read/write) to the repository:

export CVS_RSH=ssh
 
cvs -z3 -d:ext:developername@cvs.sourceforge.net:/cvsroot/filmgimp co filmgimp

This is hopefully the first and last time you need to do this, since from then on you should be able to use the remainder of the commands. If you are using ssh, I would recommend setting the CVS_RSH environment variable in your .profile since you will continue to use it for all the other commands.

Updating the files for the latest changes

Updating to the latest version can be done by cd'ing to the top level directory and running:

cvs update

You can similarly update individual file:

cvs update configure.in

or update to a particular release or version, e.g.:

cvs update -t rel-0-8
#will restore to the release tagged as "rel-0-8"
cvs update -D 2002-11-01
#will restore to the state on 11/01/2002

When updates happen it will produce a list of files each with a letter before it, the letters mean:

 
M
The file has been locally modified.
U
The file has been updated from the repository.
P
Identical to U, except that the change was applied as a "patch".
C
A conflict was detected while trying to merge you changes to the file in the repository. Your file will now contain the result of attempting to merge the two revisions. An unmodified copy of your file is also in your working direcotry with the name '.#file.revision'
?
This file does not correspond to anything in CVS. This is a good place to check for files that should be added to the repository.

Its worth stressing, that two people can make changes toto a same file, and cvs can often correctly merge the changes back in. Conflicts only happen when the changes are to the same set of code. However, its worth stressing that some peoples desires to reformat code (to their own preference) can result in more conflicts which is generally more of a pain.

Committing files back into the repository

Always before committing anything back into the repository run a:

cvs update

This ensures that you have the latest version of the code and are not going to overwrite somebody elses work.

Next run a:

cvs commit filename(s)

This will check the specified filenames into the repository, you will be prompted for a log message for the files.

Since all the files are being checked in together with the same message, try to group the files according to the patch you are making.

Please attempt to make a meaningful log message, since this is probably going to be the log message for the change log. The more the better.

Viewing what has changed

To see the differences between your version of the files and the files in the repository do:

cvs diff filename

To see the check-in log for the file do:

cvs log filename

Both these commands dont require the filename, in which case they will work recusively on the repository.

Undoing a commit

If you realised that the fixes you have made were a terrible mistake (or worse somebody elses terrible mistake), you will have to go through the painful process of reversing out a change.

The remedy - please note that you need to be ABSOLUTELY sure you type the commands correctly or you will merely compound the problem:

 

This removes all changes made between revision 1.4 and 1.5

NOTE:

 

  1. The order of the revisions!!! Highest number comes first.
  2. If you forget to specifiy a filename you will be in a worse mess than before - the revision numbers will probably be very different between the various files making up a module and if you don't tell it which file to work on, cvs will do the merge on EVERY file. Not pretty. Probably best to play it safe and do the files one by one (I warned you it was tedious).
  3. Remember to cvs commit your changes afterwards - carefully, this time!

Adding new files

To add a file (or directory) to the repository do:

cvs add filename

You will still need to run the commit to actually get the file added.

When done to a directory, you will still need to do an additional cvs add to the files in the directory.

Removing files

If a file is no longer required in the repository you should delete it, and then run the command:

cvs remove filename

at the next commit the file will be tagged for removal. NOTE: This does not actually remove it, it simply hides it for that release. So you can still go back to earlier releases and retrieve the file.

Good cvs client tools

Other links:


Questions to rower@movieeditor.com
Created January 21, 2003, contributed by Sam Richards; updated January 21, 2003