CVS is not perfect. It has few weaknesses that you either learn to live with, or you find another source code tracking package that has a completely different set of weaknesses (there's no perfect solution).
To create a new empty local CVS repository:
To create a new empty project in an existing repository:
The VENDOR branch and RELEASE tag are ignored since there are no files in the project yet, but they must still be specified (anything will do).
To use an existing project:
Once you checkout a project, you don't have to specify the repository path with -d (or CVSROOT, see below) again! The repository is recorded in each sub-directory in special files in the CVS/ sub-directory.
To see changes between the local project and the repository project:
It is a good idea to do this before committing changes to the repository (see below), to make sure you commit what you want.
To save local project changes to the repository project:
If no files or directories are specified, all files are examined. Watch out for conflicts! Conflicts can happen when another user commits before you do. If you are committing a lot of files:
will record all messages to a file called commit.log
To apply any repository changes to the local project:
The -d option creates local directories that were added to the project. The -P option prunes local directories that were removed from the project.
To add a directory to a project:
To add a TEXT file to a project:
To add a BINARY file to a project:
To remove a file or directory from a project:
The file or directory is moved to the "Attic" in the repository, but not really deleted from it.
To tag a project (or file) for later reference:
You should tag everything everytime you make a release, or otherwise want to mark a change set. Examples: milestones, new feature added, etc. A tag is the only way you can mark a change to multiple files for later reference, so use them! Tags can be removed with:
For info on a file, including tags:
To add third party source to the repository for tracking:
This adds to the VENDOR branch and tags all the files with RELEASE. This does NOT change anything else! If you want to apply any imported changes, you must do that separately! This is a topic for later, as it deals with merging changes on different branches (easy to do, but often difficult to understand).
*nix users are lazy typists. It's a fact, and the basis for many cryptic commands (like cp for copying).
If you are tired of typing:
You can set CVSROOT environment variable and then you don't have to specify it!
When you use -d it overrides CVSROOT. Often handy to put CVSROOT in your ~/.bashrc file so it is set automatically for every new shell.
Only have a short comment for the log entry on a commit or import? You can specify one with -m instead of using the editor (vi). I don't recommend this for multiple line comments. Example:
Most CVS commands can be abbreviated. See the documentation.
To access a private repository on a remote machine via ssh:
The remote user must have a valid login shell on the remote machine. You will be asked for a password on every cvs command.
HINT: If the remote machine has your public ssh key (id_dsa.pub) in its authorized_keys2 file, you won't be asked to enter a password!
Most multi-user repositories use the CVS "pserver" service:
You will only be asked for a password once! It is stored in the .cvspass file in your home directory. The user and password apply ONLY to the CVS account, and not necessarily to a shell account.
| Search Map |